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

what are '%S%', '%E%'
for example when i see Code: [Select]printf("Hello %srn", $name);
what does %s means

Email/MMS to Site
Hey guys. I'm looking for a way for a user to upload images and/or text via their cell phones. It

Multiple Pages
Hi. Im very new to php. I'm trying to create a basic login/registration page.

So I have a bas

Multi-user card game
I'm writing a batch of games and such. Lottery is finished, Poker,blackjack,etc are next. They will

Simple Question
I know this is a simple question, that if I knew what it was technically called i could probably loo

There was a problem with the request. (Code: 0)
Any Idea what could cause this? I get it randomly at best. But with both IE and FF. It derives from

PHP Redirecting
Hello everyone. Is there a way to redirect people to pages within a statement in PHP? Since there is

writing my own sobel filter convolution - something is wrong
I am trying to keep it very simple, I cant see anything wrong with my logic, could anybody help poin

Need help to modify php ELSE code
I'm trying to find a way to have the php code display a message if there is no inventory listed in t

max() problem
I have a while loop to get image names.
Code: $imagequery = mysql_query("SELECT * FROM ad_i

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