Page 1 of 1
Posted: Fri Aug 23, 2002 10:07 pm
by BackupUser
Restored from previous forum. Originally posted by tranquil.
Hi @ll.
In our PureBasic app for networking we get (sometimes) the following errprmessage reported by the wsagetlasterror() on recv_ command:
The socket is marked as nonblocking and the receive operation would block
What does that mean???
Cheers
Mike
Tranquilizer/ Secretly!
http://www.secretly.de
Registred PureBasic User
Posted: Sat Aug 24, 2002 5:19 pm
by BackupUser
Restored from previous forum. Originally posted by MrVainSCL.
Hi Mike
Winsock keeps returning the error WSAEWOULDBLOCK. What's wrong with
our program?
Not a thing. WSAEWOULDBLOCK is a perfectly normal occurrence in programs using non-blocking and asynchronous sockets. It's Winsock's way of telling your program "I can't do that right now, because I would have to block to do so."
The next question is, how do you know when it's safe to try again? In the case of asynchronous sockets, Winsock will send you an FD_WRITE message after a failed send() call when it is safe to write; it will send you an FD_READ message after a recv() call when more data arrives on that socket. Similarly, in a non-blocking sockets program that uses select(), the writefds will be set when it's okay to write, and the readfds will be set if there is data to read.
Note that Win9x has a bug where select() can fail to block on a nonblocking socket. It will signal one of the sockets, which will cause your program to call recv() or send() or similar. That function will return WSAEWOULDBLOCK, which can be quite a surprise. So, a program using select() under Win9x has to be able to deal with this error at any time.
This gets to a larger issue: whenever you use some form of nonblocking sockets, you have to be prepared for WSAEWOULDBLOCK at any time. It's simply a matter of defensive programming, just like checking for null pointers.
But as i know this dont really helped us until now to solve the prob, isnt it? ;(
PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...
greetz
MrVainSCL! aka Thorsten
Posted: Sat Aug 24, 2002 6:02 pm
by BackupUser
Restored from previous forum. Originally posted by MrVainSCL.
Hi tranquil
WSAEWOULDBLOCK (10035) Resource temporarily unavailable.
Have a look to the following site with all WinSocket Errors and there Error-Description-Details...
http://www.sockets.com/err_lst1.htm
Hope we will find the dumn strange hidden bugs and getting help from some guys to solve our problems to get our tool as fast as possible finish

We will never give up!
PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...
greetz
MrVainSCL! aka Thorsten