[21] in 6.033-lab
Re: "select" problem
daemon@ATHENA.MIT.EDU (Kevin 'Frostbyte' McCormick)
Wed Mar 26 02:11:18 1997
Date: Wed, 26 Mar 1997 02:10:46 -0500 (EST)
From: Kevin 'Frostbyte' McCormick <fbyte@sub-zero.mit.edu>
To: "Minh T. Thai" <mtthai@MIT.EDU>
Cc: 6.033-lab@MIT.EDU
In-Reply-To: <199703260656.BAA05700@cinderelly.mit.edu>
On Wed, 26 Mar 1997, Minh T. Thai wrote:
> I ran into another problem. I try to re-send a packet if I don't
> receive ACK from the receiver, so I use a timer with "select".
> Assuming my receiver is down (ie I turn it off), so the first timer go
> off, no response. When I try to block it again with "select",
> "select" return right away, saying that packet (ACK) arrives, I then
> try to read from that port with "recvfrom" then I get a "connection
> refused" error. Shouldn't "select" return at the second block?
I saw the same thing. I am guessing that a "connection refused" counts as
an exceptional condition, and though you would think that select() would
return only if you gave it an FD_SET with your socket fd in the exception
argument, in fact the kernel will inform you anyway. I could be wrong,
though I am not overly surprised this happens.
-------------------------------------------------------------------------------
Kevin "Frostbyte" McCormick fbyte@sub-zero.mit.edu
Massachusetts Institute of Technology kmccorm@mit.edu
Linux: The choice of a GNU generation.