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.9 required=5.0 tests=BAYES_00 autolearn=ham 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 13:50:14 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!news.uni-stuttgart.de!news.enyo.de!not-for-mail From: Florian Weimer Newsgroups: comp.lang.ada Subject: Re: Gnat.Sockets and non-blocking connects Date: Sun, 29 Jun 2003 22:50:13 +0200 Message-ID: <874r28ham2.fsf@deneb.enyo.de> References: <87he69j8zo.fsf@deneb.enyo.de> <87fzltnf33.fsf@inf.enst.fr> <87r85dhs90.fsf@deneb.enyo.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: albireo.enyo.de 1056919813 22996 212.9.189.171 (29 Jun 2003 20:50:13 GMT) X-Complaints-To: Cancel-Lock: sha1:8/YmquWLCuEtRs+cZO3GrTk9S6g= Xref: archiver1.google.com comp.lang.ada:39904 Date: 2003-06-29T22:50:13+02:00 List-Id: Jano writes: >> 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. Even on Windows, you can use getsockopt(2) and SO_ERROR. No need to jump through hoops. 8-)