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 13:08:24 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sn-xit-03!sn-xit-04!sn-xit-06!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "David C. Hoos" Newsgroups: comp.lang.ada Subject: Re: [OT] Two sockets questions Date: Wed, 7 May 2003 15:08:17 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <8765omaa6b.fsf@inf.enst.fr> X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Complaints-To: abuse@supernews.com Xref: archiver1.google.com comp.lang.ada:37047 Date: 2003-05-07T15:08:17-05:00 List-Id: "Stephen Leake" wrote in message news:uk7d2lekh.fsf@nasa.gov... > 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. As Sam stated, EINPROGRESS is an errno value set by the connect() function under some conditions. > > I suspect Jano is wondering how to accomplish step 2; exactly what > function (C or Ada) should be called, with what parameters? > > -- > -- Stephe > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada.eu.org > http://ada.eu.org/mailman/listinfo/comp.lang.ada >