Click here to Skip to main content
15,887,477 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
okay, i've been using winsock for a little while now, and i've run into something i'm not entirely comfortable with ignoring. I have a server run through command prompt that uses non-blocking functions. I have a client that is win32 based and uses Async Sockets. Now, my question arises from the the fact that, whether or not the server is running, or whether i put in some bogus ip that doesn't exist, the connect function always return error code 10035 (WSAEWOULDBLOCK). I don't think it should do this. Even so, when i have the server up on my comp, and i put in localhost for the ip in the client, the server does report that it has received a connection. however, connect on the client still returns the same error. what is going on here?
Posted
Comments
LaxmikantYadav 14-Nov-11 23:36pm    
WSAEWOULDBLOCK means that you are setting up your program as a non-blocking sockets program, however the computer is telling you that it would have to create a blocked connection to the socket.
JackDingler 15-Nov-11 8:51am    
Just a note... The Microsoft Winsock classes suffer from performance problems and other issues. They work fine for simple low bandwidth apps. I don't know anyone uses them for anything that requires more than light duty traffic.

It may be worth your time to learn the lower level functions for TCP/IP communications. There are many examples for them on this site and others. Telnet examples for an easy primer.

1 solution

Hi,

This error is returned from operations on nonblocking sockets that cannot be completed immediately, for example recv when no data is queued to be read from the socket.
It is a NON FATAL error, and the OPERATION SHOULD BE RETRIED LATER. It is normal for WSAEWOULDBLOCK to be reported as the result from calling connect on a nonblocking SOCK_STREAM socket, since some time must elapse for the connection to be established.
 
Share this answer
 
Comments
FatalCatharsis 15-Nov-11 14:18pm    
ah, yeh, that makes sense, cause later calls to send and recv work just fine with the server, even with that error. i guess it just takes a sec to connect.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900