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,c22949b5ebf3505f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-10 11:04:06 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!wn12feed!wn14feed!worldnet.att.net!204.127.198.204!attbi_feed4!attbi.com!sccrnsc04.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: [OT] Two sockets questions References: <5d6fdb61.0305100606.1a36d426@posting.google.com> X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 12.234.13.56 X-Complaints-To: abuse@attbi.com X-Trace: sccrnsc04 1052589718 12.234.13.56 (Sat, 10 May 2003 18:01:58 GMT) NNTP-Posting-Date: Sat, 10 May 2003 18:01:58 GMT Organization: AT&T Broadband Date: Sat, 10 May 2003 18:01:59 GMT Xref: archiver1.google.com comp.lang.ada:37157 Date: 2003-05-10T18:01:59+00:00 List-Id: >in the Gnat list the article where Microsoft explains that Windows >will return EWOULDBLOCK in an asynchronous connect. The connect is in >effect being performed and Gnat is simply reporting the underlying >Windows error. The Open code in the Claw-less sockets that will soon(?) appear on www.adapower.com contains: if Connect(Socket.Handle, Sockaddr'unchecked_access) = Socket_Error then Error := WSAGetLastError; if Error = WSAE_Wouldblock then loop FD.Count := 1; FD.Set(FD.Set'first) := Socket.Handle; Result := Select_function(0, Read_FD_Set => Null_FD_Set'unchecked_access, Write_FD_Set => FD'unchecked_access, Exceptions_FD_Set => Null_FD_Set'unchecked_access, Timeout => Zerowait'unchecked_access); exit when Result = 1; if Result = Socket_Error then ... It's intended for blocking sockets, so it sits around and polls till the select says its writable, or some other error is returned. It actually opens as non-blocking so it can get control back from the OS to do this polling, and timeout checking, etc.