2 ms·
To send data using long polling, a new http request has to be made, since long polling is basically just a regular http request with a (possibly) very slow serv
by gregmac 7y ago
To send data using long polling, a new http request has to be made, since long polling is basically just a regular http request with a (possibly) very slow server reply.
The client can either terminate the connection and make a new one, or make a second parallel request for sending and leave the first waiting for a new server response. I'm actually not sure which is more common (despite implementing apps that can do long polling, I've never paid attention at that level), nor am I entirely sure how this works with keep-alive connections (eg, can you stop waiting and issue a new http request without closing the TCP session?).
In all cases, each request from the client involves sending http headers, and if the client is a web browser, there's going to always be a few hundred bytes at least (cookie, referer, accept, user-agent, etc).