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-08 03:14:18 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!feed.news.nacamar.de!uio.no!ntnu.no!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Re: [OT] Two sockets questions Date: Thu, 8 May 2003 10:14:18 +0000 (UTC) Organization: Norwegian university of science and technology Message-ID: References: <8765omaa6b.fsf@inf.enst.fr> NNTP-Posting-Host: kiuk0152.chembio.ntnu.no X-Trace: tyfon.itea.ntnu.no 1052388858 19029 129.241.83.78 (8 May 2003 10:14:18 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Thu, 8 May 2003 10:14:18 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.lang.ada:37059 Date: 2003-05-08T10:14:18+00:00 List-Id: Samuel Tardieu wrote: >>>>>> "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). Can Adasockets do this? -- Preben Randhol http://www.pvv.org/~randhol/