From: Eric Hodel Date: 2007-10-14T08:23:56+09:00 Subject: Re: write_noblock is blocking? On Oct 13, 2007, at 14:55 , Christoffer Lernö wrote: > Anyone know what's up with TCPSocket#write_noblock actually > blocking when sending a packet that exceeds the buffer size of the > socket in 1.8.6 on Mac. > > The behaviour seems slightly counter-productive. How long does it block? I see ruby occasionally being delayed 10ms when using write_nonblock, but not repeatably for the same packet sizes. Probably my benchmark script is wrong. Could you supply a benchmark script that illustrates your problem? #write_nonblock first does rb_io_check_closed() which might call down to fseek(3) then write(2) before calling rb_io_set_nonblock(). I'm not even close to being a sockets expert though, I just read the man pages. -- Poor workers blame their tools. Good workers build better tools. The best workers get their tools to do the work for them. -- Syndicate Wars