I'm trying to write a simple server and client app to learn WinSocks. I'm using a windows app.
3 buttons and edit box. 1 button calls WSAStartup and sets stuff up. Another starts the socket and calls listen(). 3rd stops the sockets and calls WSACleanup.
3 buttons and edit box. 1 button calls WSAStartup and sets stuff up. 2nd Starts socket and connect. 3rd stops the sockets and calls WSACleanup.
Client seems to be working so far.
Problem is with the server. I'm using a Timer to call select() to see if there is anything there. When I call select I'm getting an error of WSAEINVAL. My timeval is declared as following:
and my fd_set is as follows:
and set with:
static fd_set ReadFDs, WriteFDs, ExceptFDs;
select call is:
FD_SET (sock, &ReadFDs);
FD_SET (sock, &ExceptFDs);
A zip file with all source code and exe is attached. anyhelp would be great. Thanks
if ( select (0, &ReadFDs, &WriteFDs, &ExceptFDs, &SecTime) == SOCKET_ERROR)