Opened 8 years ago

Last modified 5 years ago

#10906 new Bugs

async_connect can't be stopped on boost 1.57, win 7 64bit

Reported by: anonymous Owned by: chris_kohlhoff
Milestone: Boost 1.58.0 Component: asio
Version: Boost 1.57.0 Severity: Regression
Keywords: boost asio async_connect Cc:

Description

I currently use Windows 7 64bit, MSVC2010 and Boost.Asio 1.57. I would like to connect to a TCP server with a timeout. If the timeout expires, I should close the connection as soon as possible as the IP address (chosen by a user) is probably wrong.

With my computer, closing the socket takes about 15 seconds to complete, which makes my program not responsive for a while. On Linux the same code seems to be fine. I attach a code that reproduce the problem.

Attachments (1)

main.cpp (2.0 KB ) - added by gwenael.dunand@… 8 years ago.
code that reproduces the problem.

Download all attachments as: .zip

Change History (5)

by gwenael.dunand@…, 8 years ago

Attachment: main.cpp added

code that reproduces the problem.

comment:1 by gwenael.dunand@…, 8 years ago

My example is clearly working on Boost 1.55 and is failing on Boost 1.57. On Boost 1.55 socket.close() cancel all asynchronous call immediately, which is not the case on the 1.57 version. Best regards, Poukill

comment:2 by juan.laube@…, 7 years ago

I'm experiencing a similar problem. An executable compiled with boost 1.58 works fine in Windows 10 but has this flaw in Windows 7

comment:3 by pwiecz@…, 5 years ago

I have the same problem under Windows 10 Pro, 10.0.15063 compilation 15063 and Boost 1.62. The async_connect handler is not getting called, regardless if I call .close() or .cancel() on the socket.

comment:4 by pwiecz@…, 5 years ago

Please disregard my last comment. I've found a problem in my code. Sorry for the confusion.

Note: See TracTickets for help on using tickets.