白板的微信
WebSocketscanmakeawebpagedynamicandinteractive.HoweverinmanycasesacombinationofAjaxandHTTPstreamingand/orlongpollingcouldprovideasimpleandeffectivesolution.Forexamplenews,mail,andsocialfeedsneedtoupdatedynamicallybutitmaybeperfectlyokaytodosoeveryfewminutes.Collaboration,games,andfinancialappsontheotherhandneedtobemuchclosertorealtime.Latencyaloneisnotadecidingfactor.Ifthevolumeofmessagesisrelativelylow(e.g.monitoringnetworkfailures)HTTPstreamingorpollingmayprovideaneffectivesolution.Itisthecombinationoflowlatency,highfrequencyandhighvolumethatmakethebestcasefortheuseWebSocket.看了springbootwebsocket文档说的,什么时候用轮询,什么时候用websocket说得很清楚,我还是乖乖的用轮询吧