From: Jano <nono@celes.unizar.es>
Subject: Re: Gnat.Sockets and non-blocking connects
Date: Sun, 29 Jun 2003 20:07:39 +0200
Date: 2003-06-29T20:07:39+02:00 [thread overview]
Message-ID: <MPG.196949524d2abb5898972a@News.CIS.DFN.DE> (raw)
In-Reply-To: 87r85dhs90.fsf@deneb.enyo.de
Florian Weimer dice...
> Samuel Tardieu <sam@rfc1149.net> writes:
>
> >>>>>> "Florian" == Florian Weimer <fw@deneb.enyo.de> writes:
> >
> > Florian> Errors are reported by the R/W selectors. However,
> > Florian> nonblocking connect error reporting is not portable, see
> > Florian> Steven's UNIX Network Programming.
> >
> > In practice, it *is* portable.
>
> The SO_ERROR socket option is implemented in two different ways.
>
> > Jano, you need to check the write set,
>
> Correct.
>
> > and try to connect again. You will get an error. If the error is
> > EISCONN, you *are* connected. If this is anything else, you
> > *aren't*.
>
> Unfortunately, you don't get the error code in this case.
Mmm, I've found two workarounds for Windows:
* Trying to connect again will give an error while connecting, or will
return again Operation_would_block (that means you have failed and are
trying again, so it's kinda lame solution).
* Getting the remote address of the socket gives two different errors
when connecting and failed.
Remember, I have no problem detecting the connection is successful. (My
comments about the exception set were taken directly from the Windows
help for Select).
However, I suppose that will not work in Linux. Oh well, really I hope
these folks can get right a nice networking package for 0Y.
--
-------------------------
Jano
402450.at.cepsz.unizar.es
-------------------------
next prev parent reply other threads:[~2003-06-29 18:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-29 12:26 Gnat.Sockets and non-blocking connects Jano
2003-06-29 13:42 ` Florian Weimer
2003-06-29 14:17 ` Samuel Tardieu
2003-06-29 14:29 ` Florian Weimer
2003-06-29 18:07 ` Jano [this message]
2003-06-29 20:50 ` Florian Weimer
2003-06-29 21:13 ` Samuel Tardieu
2003-06-29 21:27 ` Florian Weimer
2003-06-29 22:38 ` Samuel Tardieu
2003-06-29 23:00 ` Jano
2003-06-29 23:00 ` Jano
2003-06-30 15:07 ` Jano
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox