-
Notifications
You must be signed in to change notification settings - Fork 634
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: stream truncated #824
Comments
It is technically an error, but unfortunately many HTTP servers and HTTP clients are misbehaved, see: #38 You might need to check for it specifically and just ignore it. |
Oh ok. Then I will just ignore it when shutting down the stream. |
Just a note, usually it is better to let the server perform the close. As a client you can just wait for the server to close the connection (set a timeout in case this never happens). This will result in the server receiving the TIME_WAIT state rather than the client, which is preferable: http://www.serverframework.com/asynchronousevents/2011/01/time-wait-and-its-design-implications-for-protocols-and-scalable-servers.html |
What do you mean with wait? |
You should read the article |
you are contradicting your article, it says client should close socket, server should wait for client to close |
The article states clearly: "Inbound connections are less affected by TIME_WAIT. Whilst the a connection that is actively closed by a server goes into TIME_WAIT exactly as a client connection does the local port that the server is listening on is not prevented from being part of a new inbound connection." Thus, the server should initiate the close. Also, the WebSocket protocol RFC states that the server should initiate the close: The article also states: "A TCP peer initiates an "active close" if it is the first peer to call Close() on the connection. In many protocols and client/server designs this is the client. In HTTP and FTP servers this is often the server. " There is an overwhelming preponderance of evidence which states that the server should 1. initiate the TCP close process, and 2. prefer to be left with the TIME_WAIT state. |
the article clearly states
all servers do establish outbound connections |
What? No... an outbound connection is established by calling |
in this context outbound connection is established by calling connect(3) and "server" means host, not process, since ports are global |
Typically servers If that's not accurate, then I'm not sure exactly what you're driving to @pal666. |
Hi,
when I am using an ssl stream, like in your http client example, I am getting an error when shutting down the stream:
I can just ignore it by checking against that specific error
ec == boost::asio::ssl::error::stream_truncated
, but I wanted to know if this is 'normal' since in the example you only check foroperation_aborted
.The text was updated successfully, but these errors were encountered: