Opened 13 years ago
Closed 13 years ago
#3861 closed Bugs (invalid)
Closing a socket doesn't cancel all pending asynchronous send operations
Reported by: | Owned by: | chris_kohlhoff | |
---|---|---|---|
Milestone: | Boost 1.42.0 | Component: | asio |
Version: | Boost 1.40.0 | Severity: | Problem |
Keywords: | Cc: |
Description
Using the attached sample program (a slightly modified version of the daytime3 tutorial). When I connect with a telnet session to the server and close the connection directly I get the following output from the server: Transfer status: Success. Transfer status: Broken pipe. Transfer status: Broken pipe. Transfer status: Broken pipe.
After the first error I close the socket and would expect a boost::asio::error::operation_aborted error instead of the broken pipe.
Reproduced under both Debian Lenny (gcc 4.3.4) and Windows XP (MSVC 2008).
Attachments (1)
Change History (2)
by , 13 years ago
Attachment: | server.cpp added |
---|
comment:1 by , 13 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
The behaviour is correct. The write operations are not pending when you call close, it's just that the handlers haven't been called yet. The write operations themselves completed with an error as soon as the client closed the connection.
Sample program to reproduce the bug