?

Log in

Previous Entry | Next Entry

Timeouts In Blocking Socket Code

I was wondering how to handle timeouts correctly while blocked for I/O on sockets, with as few system calls as possible.

Thanks to slamb for reminding me of SO_SNDTIMEO/SO_RCVTIMEO! Combined with recv() letting me do short reads, I think I've got what I need for something completely portable.

Comments

( 3 comments — Leave a comment )
azrhey
May. 24th, 2008 01:54 am (UTC)
You forgot to take into account this:
skjalm
May. 24th, 2008 05:58 am (UTC)
Re: You forgot to take into account this:
I'm sure someone could come up with some really bad jokes that involve blocking her I/O ports...
muadda
May. 27th, 2008 11:35 am (UTC)
don't be evil
damn... first, threads, and now, blocking socket and synchronization with timeouts... I don't recognize you, Pierre! :-)

( 3 comments — Leave a comment )