Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shutdown before close #347

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

shutdown before close #347

wants to merge 3 commits into from

Conversation

kgbook
Copy link

@kgbook kgbook commented Sep 24, 2019

Tick value is 5 second by default, timer will expire if interval betweent two request is larger than 5 seconds.

Server will close the socket if timer is expired, but Client still send HTTP request to the socket.
the length of data usingasync_read_some from the socket is 0, HTTP request from client skipped, and callback will not invoke!

It's ok if shutdown before close, so Client will receive FIN and close the socket, then start 3-way handshake.

Have tested using tcpdump and Wireshark.

boost/asio/basic_socket.hpp also recommend to shutdown before close, reference below:

@note For portable behaviour with respect to graceful closure of a connected socket, call shutdown() before closing the socket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant