This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fixing openssh to avoid occasional spurious connection failures

[Get raw message]
On Thu, Nov 15, 2001 at 05:14:55PM -0500, Jonathan Kamens wrote:
> >  Date: Thu, 15 Nov 2001 23:06:25 +0100
> >  From: Corinna Vinschen <vinschen@redhat.com>
> >  
> >  Don't think so.  I think we could find a workaround by assigning
> >  local socket numbers in another range (>32768 or so).
> 
> This will not solve the problem.
> 
> If you read my test program, you will see that I am calling bind() on
> the socket before connect(), and the bind() succeeds *** even though
> the connect subsequently fails with WSAEADDRINUSE ***.  So there's no

Oh, btw., I never saw that test program.  However, calling bind
before calling connect is superfluous and a bit dangerous since

  from MSDN:
  Client applications usually need not call bind at all.  connect
  chooses an unused port automatically. When bind is called with
  a wildcard address (involving ADDR_ANY), a WSAEADDRINUSE error
  could be delayed until the specific address is committed. This
  could happen with a call to another function later, including
  connect, listen, WSAConnect, or WSAJoinLeaf.

So, I'm a bit tired right now (about midnight)... does SSH call
bind before connect?

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]