From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,URI_HEX autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c6c265459ff33db7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-29 11:09:32 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!fu-berlin.de!uni-berlin.de!69116-cm.able.ES!not-for-mail From: Jano Newsgroups: comp.lang.ada Subject: Re: Gnat.Sockets and non-blocking connects Date: Sun, 29 Jun 2003 20:07:39 +0200 Message-ID: References: <87he69j8zo.fsf@deneb.enyo.de> <87fzltnf33.fsf@inf.enst.fr> <87r85dhs90.fsf@deneb.enyo.de> NNTP-Posting-Host: 69116-cm.able.es (212.97.169.116) X-Trace: fu-berlin.de 1056910170 32410848 212.97.169.116 (16 [49872]) X-Newsreader: MicroPlanet Gravity v2.50 Xref: archiver1.google.com comp.lang.ada:39895 Date: 2003-06-29T20:07:39+02:00 List-Id: Florian Weimer dice... > Samuel Tardieu writes: > > >>>>>> "Florian" == Florian Weimer 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 -------------------------