bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: non-blocking connect fails with no pending acceptors


From: Roland McGrath
Subject: Re: non-blocking connect fails with no pending acceptors
Date: Tue, 17 May 2005 22:03:13 -0700 (PDT)

> If a program calls connect on a non-blocking socket with no pending
> acceptors (i.e. threads calling accept on the listening end of a
> socket), connect fails with EWOULDBLOCK.

This is doubly wrong.  When listen has been called and the queue limit not
reached, then the connection should be established immediately and not wait
for someone to call accept.  When the connection cannot be established
immediately and the socket is nonblocking, connect should return
EINPROGRESS.  This should happen when the queue limit has been reached.
(And then the client socket should be in "waiting to connect" state and a
later connect call should return EALREADY.)

I haven't read through your patch yet, but these are the semantics that
pflocal should be implementing.  For a real network stack it's the same.
The listen queue limit being reached on the remote end corresponds to the
client getting an ACK as if its packet hadn't gone through.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]