Opened 7 years ago

#11527 new Bugs

socket connection error

Reported by: danial1360@… Owned by: chris_kohlhoff
Milestone: To Be Determined Component: asio
Version: Boost 1.58.0 Severity: Problem
Keywords: socket, connect Cc:

Description

image the following code! it uses 2 threads and creates simple server client connection the code is simple and I use synchronize functions to make it easier to understand. in the client thread if I use :

while (error_ && it != end)

{ skt.close(); skt is socket skt.connect(*it++, error_); }

the the program crashes when it want to read or write something to the socket !! but if I use:boost::asio::connect(skt, it); then I works perfectly!!! notice that i will have this problem only if I use the code in two threads inside a single process. if I run the code in two different processes everything is fine. I am using windows 7 x67 and VS2013 but I am using 32bit project and 32bit boost library .

Attachments (1)

BUG.cpp (1.9 KB ) - added by danial1360@… 7 years ago.
source code of the problem

Download all attachments as: .zip

Change History (1)

by danial1360@…, 7 years ago

Attachment: BUG.cpp added

source code of the problem

Note: See TracTickets for help on using tickets.