Dailydave mailing list archives

Re: Today's Windows Trivia Event


From: Dave Aitel <dave () immunitysec com>
Date: Wed, 30 Mar 2005 12:47:59 -0500

The reason I don't like timeouts is because I don't know how far away the host is to begin with. It might be 2 seconds away, which makes any reasonably timeout moot. So Neil wins the shell! :>

-dave


Chris Anley wrote:

Another solution; use select(), and a non-blocking socket...

i = 1;
ioctlsocket( s, FIONBIO, (unsigned long *)&i );

Then implement the timeout of your choice with select(). If you're banner grabbing, you might want to

setsockopt( s, SOL_SOCKET, SO_RCVTIMEO, ...

to set a recieve timeout. Also, you might want calls to block after the connect, so you can set the socket to blocking again with

i = 0;
ioctlsocket( s, FIONBIO, (unsigned long *)&i );

Probably less tidy than you wanted, but that should work.

     -chris.

Dave Aitel wrote:

Conundrum:
setsockopt(sock,SO_DONOTSUCK);




_______________________________________________
Dailydave mailing list
Dailydave () lists immunitysec com
https://lists.immunitysec.com/mailman/listinfo/dailydave


Current thread: