Re:Lamest bug we ever encountered
by radarsat1 on Saturday December 10, 2011 @11:22PM
(#3339264)
He didn't mention how the logging was done but if it was over a TCP connection then the send() call probably blocked until it timed out since the sleeping computer didn't close the socket nicely, then it had to re-establish the connection. Although reliability is nice, if I were writing a remote logger for a something like a game, I think I'd use UDP.
[ Parent
| on HN ]
> although reliability is nice ... UDP
Would you not use send() with MSG_DONTWAIT? You get the reliability of TCP and you get feedback if there is any potential blocking. (But I certainly am not a socket guru.)
Definitely, asserting non-blocking flags for the socket options is also a good idea.
Re:Lamest bug we ever encountered
by AndyKelley on Sunday December 11, 2011 @01:27AM
(#3339445)
Are you trying to explain how it's possible for some of the consoles to freeze but others not while talking to the same sleeping computer? If so, I did not understand your explanation.
Re:Lamest bug we ever encountered
by alexgartrell on Sunday December 11, 2011 @01:29AM
(#3339447)
I believe socket writes don't block until you've filled the internal socket buffer, so it's likely that the unaffected machines simply hadn't done this yet.
Re:Lamest bug we ever encountered
by AndyKelley on Sunday December 11, 2011 @03:30PM
(#3340981)
ah, there's the missing piece of information. Now I got it, thanks.