Problems with connect and select...
See below for most recent message
I'm attempting to make a "multithreaded" port scanner that uses the select function (instead of creating new threads). It's being developed with C using the Winsock API on the Windows 2000 platform. I'm using MSVC++6. The problem (I believe) is in the scan_list() function (located in sockets.c). I try to call connect on each of the sockets located in the list and -1 is returned everytime. I tried calling WSAGetLastError and it returns 10035 everytime.
Quote:
error code 10035 - Resource temporarily unavailable.
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 nonfatal 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.
Maybe I'm just thick, but I'm rather confused on how to fix this. I've ran through the program many times with the debugger and everything seems ok (aside from the connect() calls). I've attached the MSVC++6 project if anyone would like to take a look at it and try to help me out.
Thank you! :)