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=-0.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,131e3d946b949413 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.68.136.104 with SMTP id pz8mr9124355pbb.3.1363060690963; Mon, 11 Mar 2013 20:58:10 -0700 (PDT) MIME-Version: 1.0 Path: q9ni12130pba.1!nntp.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news.astraweb.com!border2.newsrouter.astraweb.com!newspeer1.nac.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!xlned.com!feeder1.xlned.com!border2.nntp.ams.giganews.com!nntp.giganews.com!weretis.net!feeder1.news.weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!aioe.org!.POSTED!not-for-mail From: anon@att.net Newsgroups: comp.lang.ada Subject: Re: UDP networking with Ada Date: Fri, 8 Mar 2013 06:47:29 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: References: Reply-To: anon@att.net NNTP-Posting-Host: Bdio/1RhB138rgDmplfuTA.user.speranza.aioe.org X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: IBM NewsReader/2 2.0 X-Received-Bytes: 2544 Date: 2013-03-08T06:47:29+00:00 List-Id: Now, most of GNAT's add-on packages like Florist uses TCP. But GNAT.Sockets does supports both TCP and UDP protocols. And I do have a few examples that uses UDP. -- Create an UDP socket and I/O channel Create_Socket ( Server_Socket, Family_Inet, Socket_Datagram ) ; Server_Address := ... Server_Channel := Stream ( Server_Socket, Server_Address ) ; -- For data transfer use the attribute "Input" and "Output" Data := Character ' Input ( Server_Channel ) ; Unsigned_32 ' Output ( Server_Channel, Response ) ; -- Normal termination Close_Socket ( Server_Socket ) ; Note: 1) At the movement GNAT only uses IP version "4". Trying to bind a ipv6 socket will generate an exception error. May be AdaCore will update GNAT.Sockets to allow "6" by their 2013 release date. Some time between May and July. 2) In using selection calls. The Create_Selection routine creates two additional sockets that are not used. This might be a problem, depending your IP security sub-systems. In , "Peter C. Chapin" writes: >I have an interest in doing some network programming in Ada using UDP. I >assumed I could use GNAT.Sockets but in reading the specification of >that package it appears that it only supports TCP. I browsed around the >various other GNAT packages but I didn't see anything for UDP and now >I'm wondering what my options are. > >I assume Florist probably would work on Unix-like systems and Win32Ada >would work on Windows systems (haven't looked at them in detail), but I >was hoping for something cross-platform "out of the box." > >Or maybe I'm misunderstanding what I see with GNAT.Sockets? > >Peter