comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: UDP networking with Ada
Date: Fri, 8 Mar 2013 09:37:37 +0100
Date: 2013-03-08T09:37:37+01:00	[thread overview]
Message-ID: <uorwyniban6c$.1bcc02oqe2aw3$.dlg@40tude.net> (raw)
In-Reply-To: SL-dnUB_sIRxqKTM4p2dnAA@giganews.com

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



  parent reply	other threads:[~2013-03-08  8:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-08  0:50 UDP networking with Ada Peter C. Chapin
2013-03-08  3:46 ` Randy Brukardt
2013-03-08 18:28   ` Tero Koskinen
2013-03-08  6:47 ` anon
2013-03-08  7:50   ` Simon Wright
2013-03-08 12:14   ` Peter C. Chapin
2013-03-08  8:37 ` Dmitry A. Kazakov [this message]
2013-03-08 11:50   ` Simon Wright
2013-03-08 12:12     ` Dmitry A. Kazakov
2013-03-08 12:17       ` Peter C. Chapin
2013-03-08 15:39         ` Dmitry A. Kazakov
2013-03-08  8:58 ` Jacob Sparre Andersen
2013-03-08 11:58 ` Stephen Leake
2013-03-16 22:27 ` Kevin K
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox