I can make a socket listen on a port, but I don't know how to make it timeout if it doesn't recieve any data on that port within, say, 10 seconds.
Does anyone know where I'm going wrong?
SOCKET sock = INVALID_SOCKET;
sock = socket ( AF_INET, SOCK_DGRAM, 0 );
if ( INVALID_SOCKET == sock)
AfxMessageBox("Error: Broadcast DoUdp - INVALID_SOCKET");
int iTimeoutLen = 10;
err = setsockopt(sock, SOL_SOCKET,
(CHAR *) &iTimeoutLen,sizeof(int));