meltwater / served

A C++11 RESTful web server library
MIT License
710 stars 174 forks source link

Long polling #30

Closed asmyasnikov closed 6 years ago

asmyasnikov commented 6 years ago

Hi! I want to process request as long polling service. Already this feature implemets on web-server through sending first byte of response and wait on server-side of changing some state for finalize response. This hack provide long polling connection of most clients. I was tested this behaviour and receive nothing (against one byte of response) and client (curl, chromium and firefox) was disconnected after 60 seconds (default time of HTTP-connection). What I do (compile, coding or using) libserved for using long polling? And if this not supported can you add long polling feature to next release?

Jeffail commented 6 years ago

Hey @asmyasnikov, as long as you don't set an explicit timeout on the served instance then it is only the clients that will terminate the connection on a long poll. You shouldn't need to do anything specific with served to get this to work. I suspect your clients are terminating the connection and you'll need to explicitly override their own timeouts.