select()/accept() problem in 2.0.38

Johan Adolfsson (johan.adolfsson@axis.com)
Mon, 12 Mar 2001 14:11:06 +0100


In short:
My listener socket _sometimes_ gets confused when a client
connect and closes very fast when the server has outstanding data.

The read fd_set with the listener socket is not set
by the select() call for new connections,
but if I do accept() on it anyway I will get the new socket!

I know this could happen anyway but if I don't do the accept()
the fd_set will not be set and the application will not handle
any new connections.
New clients will think they are connected depending on the
backlog parameter to listen(), and then they will timeout.

More details:
I use non-blocking sockets.

The select() has a timeout of 20ms since I need to
poll the serial port status pins.

I don't get this on 2.4.

When it happens I get a EPIPE from write(),
(sometimes it works but then I usually get ECONNRESET instead
of EPIPE but not always)
It seems to be timing dependent.

Any ideas?

/Johan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/