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: m.de.wever@… 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)

server.cpp (2.6 KB ) - added by m.de.wever@… 13 years ago.
Sample program to reproduce the bug

Download all attachments as: .zip

Change History (2)

by m.de.wever@…, 13 years ago

Attachment: server.cpp added

Sample program to reproduce the bug

comment:1 by chris_kohlhoff, 13 years ago

Resolution: invalid
Status: newclosed

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.

Note: See TracTickets for help on using tickets.