Opened 11 years ago

Closed 10 years ago

#5605 closed Bugs (invalid)

http async client example doesn't close on error correctly

Reported by: Frank <fhriley@…> Owned by: chris_kohlhoff
Milestone: To Be Determined Component: asio
Version: Boost 1.46.1 Severity: Cosmetic
Keywords: Cc:

Description

In handle_connect, the final else block needs a "socket_.close();"

Change History (1)

comment:1 by chris_kohlhoff, 10 years ago

Resolution: invalid
Status: newclosed

Actually it is not required since no further asynchronous operations are started. The socket will then be closed automatically when the class's destructor runs. In any case, the example has since been converted to use the asio::async_connect() function, which has simplified the example logic somewhat.

Note: See TracTickets for help on using tickets.