Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why setting a client-side timeout when using long polling?

In almost every long polling examples I see, there is something like a timeout of 30 seconds client-side. What is the precise reason for this?

like image 583
Supercactus Avatar asked Feb 15 '13 20:02

Supercactus


1 Answers

Some routers, proxies or whatever device there is in the middle might decide to drop TCP/IP connections being idle for extensive period of time. Also refreshing connection once in a while makes sure you'll discover server failure quicker.

like image 175
Tomasz Nurkiewicz Avatar answered Sep 26 '22 16:09

Tomasz Nurkiewicz