Open connection difference in Comet and Websockets -
i trying understand difference in websocket , comet model. per understanding,
in comet model, connection remains opened until server has push client. once server pushes data client, connection closed , new connection established next request. it not considered approach connection may remain open long time (causing intensive use of server resources) or may timeout.
on other hand, websockets start handshake connection , once both client , server agree exchange data, connection remains open.
so in both case connection remains open long time (especially websocket). so isnt't drawback of websocket keep connection open. take reference of signalr in asp.net discuss concept.
first, let's clarify comet comes in 2 flavors: http streaming , http long polling. referring long polling. (see this other answer terminology).
in 3 cases (websocket, http streaming, , http long polling) underlying tcp socket kept open. that's main feature of kind of techniques , not side effect. want socket stay permanently open (i'm oversimplifying now), data can pushed asynchronously , low latency.
as correctly said, implies server must able handle large number of open sockets without wasting resources. , that's 1 of key elements in choice of comet/websocket server.
Comments
Post a Comment