From: Emmanuel Gaillot Date: 2007-07-31T18:25:12+09:00 Subject: Re: Puzzled about Ruby's behaviour re. closed sockets Robert, Thanks for your answer. > With a modified version I get > > (Unexpectedly) passed 2 times; > {Errno::ECONNABORTED=>998} I've tried your modified version. Here is a typical output when attempting once to write in the closed pipe : ---------------------------------------------- (Unexpectedly) passed 960 times; {Errno::EPIPE=>38, Errno::ECONNRESET=>2} ---------------------------------------------- ... this to be compared with typical output when attempting to write 6th times in a row in the closed pipe : ---------------------------------------------- (Unexpectedly) passed 4 times; {Errno::EPIPE=>987, Errno::ECONNRESET=>9} ---------------------------------------------- Strangely enough, I don't seem to get any Errno::ECONNABORTED ever. > I guess it's a combination of timing and buffering issue. I've reached the same conclusion -- which brings me to the question: what can I do to make the combination of timing and buffering predictible? Or how may I get around it? -- Emmanuel.