[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: non-blocking connect fails with no pending acceptors
From: |
Thomas Bushnell BSG |
Subject: |
Re: non-blocking connect fails with no pending acceptors |
Date: |
Wed, 18 May 2005 07:46:39 -0700 |
User-agent: |
Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) |
Roland McGrath <roland@frob.com> writes:
>> 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.)
Right. I misunderstood and thought not even listen had been called.
If listen has been called, then connections should complete, local
ones should complete instantly.