From mboxrd@z Thu Jan 1 00:00:00 1970 Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: In memory Stream Date: Sun, 18 Feb 2024 10:06:46 +0000 Organization: A noiseless patient Spider Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain Injection-Info: dont-email.me; posting-host="ad4299653a872e9f5cf3ec88917e7b30"; logging-data="1049352"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Nwrkazon6QIF8ltbTle2rWZcm2Z/vs8k=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (darwin) Cancel-Lock: sha1:4AteLeBxUBWw3iGSH23uNpUTaHY= sha1:HnoE3vq8TwSWyTf0J4FcqI2SJLE= Xref: news.eternal-september.org comp.lang.ada:66089 List-Id: "Dmitry A. Kazakov" writes: > UDP is a kind of thing... Basically, there is no use of UDP except for > broadcasting, e.g. in LAN discovery. Worked for us, sending radar measurements p-2-p at 200 Hz > As for taking apart a UDP packet, it is straightforward. You simply > declare a stream element array of the packet size and map it on the > packet using: > > pragma Import (Ada, A); > for A'Address use UDP_Packet'Address; > > And somewhere > > pragma Assert (Stream_Element'Size = 8); > > just in case... OK if the participants all have the same endianness. We used XDR (and the translation cost is nil if the host is big-endian, as PowerPCs are; all the critical machines were PowerPC).