From: Brian Candler Date: 2010-09-28T15:01:15+09:00 Subject: Re: TCP Socket: Connection reset, but Select says it's valid Scott Cole wrote: > I'm running a server that sometimes encounters a > connection-reset-by-peer error when reading data from a client. I'm > calling IO.Select to verify that there are characters to be read, but > occasionally the "rescue" below is activated when I do my gets. Your code prints the exception class and message, what do you see? I > presume this means the socket was closed after Select noticed there were > characters to be read but before I actually try to read them. select returns true for an EOF-condition too. From `man 2 select`: Three independent sets of file descriptors are watched. Those listed in readfds will be watched to see if characters become available for reading (more precisely, to see if a read will not block; in particu‐ lar, a file descriptor is also ready on end-of-file) -- Posted via http://www.ruby-forum.com/.