Async WSAConnect failed on XP with error code = 2 ("File not found")


Posted on 16th Feb 2014 07:03 pm by admin

Hi all,

I have very strange bug, please help me if you can.

It is reproduced only on these conditions : WinXP, VS2005, VS2008, build in debug, execute without debugging.

On any other configuration or OS this code works fine.
Also works ok with old VC6.0.
I Tested it also on another XP just in case, same behavior.

I've isolated problematic code in a simple console application (no threads etc).
Just putting :
WSAEventSelect(...., FD_CONNECT | FD_READ | FD_CLOSE)
before WSAConnect, and WSAConnect will fail with error code 2 (means : File not found).
Which is not described in MSDN...also this is fail code when it really cannot connect (server is down or invalid).

If I remove WSAEventSelect (i.e. sync connect) all works.
If I debug code, all works.
If I put break point on WSAConnect line and run this app outside studio, then reach this breakpoint (start debugging) and step through WSAConnect WITH debugger it works....

I'm unable to find anything in the net about this strange behavior.
Also I'm trying to connect to FTP server, which works fine.
I'm attaching full code. It only test WSAConnect in async mode, nothing more.

10x,
Filip

No comments posted yet

Your Answer:

Login to answer
107 Like 25 Dislike
Previous forums Next forums
Other forums

How to read posted binary data from a mobile device and post it to a web server?
Here is the senario...

I have a mobile device (MD) that posts binary data to a Web Server (WS

how to read and write into a word document using php...?
hi,
I need,reading and writting into a word document using php.




Thank u inadva

Pagination
Hi All,

I think I'm finally getting somewhere with pagination!

I can now submit a quer

Give me all your tricks for minimizing jar file size

Hi, I'm coming close to releasing my J2ME game... I am kicking up against the 64k size barrier w

Grabbing Values From an Array for Posting
I have a grid array that I am using with a form that when it hits the currently named test.php it lo

Warning: session_start() [function.session-start]: Cann.....
hi, can someone help me with this? I keep getting this error....

Warning: session_start() [fu

need help in update query
hi
i have a dynamic form. i need help in how can i use update query when values from dynamic for

date("now") prints out wrong date ?
Hi Guys
Anyone know why and how I can fix it ?

upload only text files
hi guys i want to upload only text like like (pdf,note pad and ofiice files) so can any one please t

Target costs on Process orders not calculating
Hi All,

We have released standard costs for all the materials. We have also done Goods r

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash