On Sun, 5 Oct 2003, Gordon Messmer wrote:

> Jon Nelson wrote:
> >
> > If I may, I would suggest that neither patch is correct.
> > You normally want to call connect *once*, and then select on the file
> > descriptor.
>
> connect() doesn't return a file descriptor in all cases.  This patch
> addresses the case where connect() returns -1, and sets errno to EAGAIN.
>   This happens when the socket you're trying to connect to is still
> listening, but its listen queue is full.  This happens sometimes when a
> storm of courier's processes try to connect to a filter before that
> filter gets a chance to accept the connections.

Oh, yeah.  Gotcha!  Nice catch!

> > At the end of your proscribed time limit, or earlier, the
> > file descriptor will be definitively connected, failed to connect, or
> > still trying.  Sam's patch is much closer, IMO, but still not quite
> > correct, because the patch calls connect multiple times.
>
> It only calls connect again if connect didn't return a file descriptor.

My mistake, and thanks for correcting me in a courteous and
police fashion, which I do appreciate.

--
Democracy is two wolves and a sheep voting on what to have for dinner.
Liberty is two wolves attempting to have a sheep for dinner and
finding a well-informed, well-armed sheep.

Jon Nelson <[EMAIL PROTECTED]>
C and Python Code Gardener


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to