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-Thread: 103376,131e3d946b949413 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.66.254.231 with SMTP id al7mr221354pad.26.1362744876375; Fri, 08 Mar 2013 04:14:36 -0800 (PST) Path: q9ni5586pba.1!nntp.google.com!news.glorb.com!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Fri, 08 Mar 2013 06:14:35 -0600 Date: Fri, 08 Mar 2013 07:14:34 -0500 From: "Peter C. Chapin" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130221 Thunderbird/17.0.3 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: UDP networking with Ada References: In-Reply-To: Message-ID: <58CdnbCaDPK2S6TM4p2dnAA@giganews.com> X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-2p19wiCGU3ptkEX8ag5Rs2nmDBuOjbWODlOlxY5GsFWwGF20BtJs1CmSnWdp4Vn5ymZ4Z/5Ep+6ah5K!+4TOcdyGtOaobBp8Yl5/i5DGukgIN23fKSgJS9oiFelRHPZknUSulApr4RTgoEY= X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2465 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2013-03-08T07:14:34-05:00 List-Id: On 03/08/2013 01:47 AM, anon@att.net wrote: > 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 ) ; Good to know! I read these comments in the specification: type Socket_Type is private; -- Sockets are used to implement a reliable bi-directional point-to-point, -- stream-based connections between hosts. and just assumed datagram sockets were not supported. That's what I get for reading comments, I guess! But now I also see: type Mode_Type is (Socket_Stream, Socket_Datagram); -- Stream sockets provide connection-oriented byte streams. Datagram -- sockets support unreliable connectionless message based communication. So I think I'm good to go. Thanks. Peter