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, 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.180.106.73 with SMTP id gs9mr3035792wib.2.1363061045729; Mon, 11 Mar 2013 21:04:05 -0700 (PDT) Path: bp2ni87031wib.1!nntp.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!85.12.40.130.MISMATCH!xlned.com!feeder1.xlned.com!feed.xsnews.nl!border-1.ams.xsnews.nl!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!weretis.net!feeder1.news.weretis.net!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: UDP networking with Ada Date: Fri, 8 Mar 2013 09:37:37 +0100 Organization: cbb software GmbH Message-ID: References: Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2013-03-08T09:37:37+01:00 List-Id: On Thu, 07 Mar 2013 19:50:51 -0500, Peter C. Chapin wrote: > 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. [...] > Or maybe I'm misunderstanding what I see with GNAT.Sockets? GNAT.Sockets work perfectly well with UDP. We are using them extensively, e.g. for the XCP protocol, wich is UDP. You go: Create_Socket Set_Socket_Option (if needed) Bind_Socket Receive_Socket (to receive packets) As Simon said, don't use streams. It does not make much sense with UDP which is packet-oriented. If you want streams crossing packet borders you must create a stream object of your own on top of the packets, and after you ordered packets (UDP does not guarantee that send and receive orders are same) and resent missing ones (UDP does not guarantee delivery). -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de