Simple-Web-Server icon indicating copy to clipboard operation
Simple-Web-Server copied to clipboard

Question about Timeouts.

Open SethHamilton opened this issue 8 years ago • 2 comments

https://github.com/eidheim/Simple-Web-Server/blob/b9d4be229f41e3eda72394451d479f5245d2a600/server_http.hpp#L233

Does this associate the timer with connection so it gets cancelled automatically when the connection is closed?

SethHamilton avatar Nov 02 '17 19:11 SethHamilton

The timers are not associated with sockets, but all the async operation handlers start with calling the Connection::cancel_timeout()-function. See for instance https://github.com/eidheim/Simple-Web-Server/blob/b9d4be229f41e3eda72394451d479f5245d2a600/server_http.hpp#L423. In the event of a connection close, one of these handlers will be called with an error code ec set.

eidheim avatar Nov 03 '17 07:11 eidheim

Cool, I see it. Thank you.

SethHamilton avatar Nov 03 '17 17:11 SethHamilton