Open mobileben opened 5 years ago
In what environment? Is this with ASIO-based http_listener
or WinHttp-based?
In both cases, I thought they were happily doing HTTP/1.1 and keep-alive by default...
@garethsb-sony my bad sorry. For asio, I'm running this on Ubuntu 16.04. I did a grep
for keep-alive (case insensitive) and found it only existed in the client as well as it did show up in the window http as a header string, however I don't think anything is really done with it.
There is an option that can be set for keep_alive (I've never used it, but I see it exists) with asio, but it isn't being used. I also don't see anything for changing timeouts.
I do see socket_base::reuse_address
is being used, but I don't know if that suffices.
@garethsb-sony does cpprestsdk support keep alive once it act as client?
Hmm, there are a few inter-related things here, TCP keep-alive, HTTP keep-alive, support for HTTP pipelining, etc. As far as I know, http_listener
and http_client
don't explicitly close connections by default, so reuse is possible. However, as far as I can tell, there's nothing to handle the Keep-Alive
response header directly, nor any support for HTTP pipelining. I'd really like to build support for HTTP pipelining on the client side, but haven't had the time to investigate other than deciding it would need an API modification as well as implementation work.
@garethsb-sony Thank you! I'm eager to use the keep alive in client side to save a lot of resource, wish it could be supported as soon! B.R.
In the midst of trying to figure out why network calls are so slow, It seems the code itself on the http server/listener side doesn't actually support keep-alive.
Are there any plans to support this? Or have I overlooked something?