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-07 12:55:35 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: [OT] Two sockets questions Date: 07 May 2003 15:52:30 -0400 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: <8765omaa6b.fsf@inf.enst.fr> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1052338067 3533 128.183.235.92 (7 May 2003 20:07:47 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 7 May 2003 20:07:47 GMT Cc: sam@rfc1149.net User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:37043 Date: 2003-05-07T20:07:47+00:00 List-Id: Samuel Tardieu writes: > >>>>> "Jano" == Jano writes: > > Jano> Is there a way of performing a connect without blocking on it? I > Jano> suspect not... and if not in Ada, by other means? > > Sure! I'll describe the process in C, I do not know whether > GNAT.Sockets allows you to do all those steps: > > 1) Create your socket > 2) Make it non-blocking > 3) connect() will return immediately with either 0 (success), -1 > with errno set to EINPROGRESS or -1 with another error (real > error). > 4) If the result was -1/EINPROGRESS, do a select() on the socket for > writing. When it tells you that you can write, write() 0 bytes. If > there is no error (write() returns 0), then you are > connected. Otherwise, you will get an error (typically > -1/ENOTCONN). This is not C. It is English. Hm, I suppose "EINPROGRESS" could be a C macro, but it could equally well be an Ada named number. I suspect Jano is wondering how to accomplish step 2; exactly what function (C or Ada) should be called, with what parameters? -- -- Stephe