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,8bbf2dbc48e08e2f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Tue, 18 Jul 2006 16:11:53 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <1153215666.455584.201990@m73g2000cwd.googlegroups.com> <1fpj192j49rf4$.ma23qkoukku3.dlg@40tude.net> <4i3r3nF215adU1@individual.net> Subject: Re: Question about Streams and UDP sockets using GNAT.Sockets Date: Tue, 18 Jul 2006 15:58:06 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-GgL4fuc2tMfu2WpY3IdkHGUp4mR/3IYHxhjCvX/H0r7Ji7idbtciLhRMJDU0Waz51RTyma8911tM5YD!BfbXmZuWWpnuPc1Gf3TNAMNzicdtK9ojjZ7Pc9fYdNDB6UQ5QSe81NPaB2Azmtnwpa5OSVIjFP6G!KV9q0FaOLwymKg== X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net 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.32 Xref: g2news2.google.com comp.lang.ada:5789 Date: 2006-07-18T15:58:06-05:00 List-Id: "Alex R. Mosteo" wrote in message news:4i3r3nF215adU1@individual.net... ... > I've workarounded this in past versions of GNAT using a direct call to the > Write procedure in Ada.Streams, though you must use a Stream_Element_Array > instead of a String. Doing so your array is transferred in a single call > and packet. (Contrarily to using the 'Write attribute of > Stream_Element_Array, that will also make a call for every element, which > is very CPU expensive for large arrays). If the type you are sending is more complex than a simple array, you probably should try to use 'Write (Unchecked_Conversion won't necessarily work on complex types). The best way to do it is to create a buffer stream type that simply puts the bytes in a Stream_Element_Array. Then use the direct call to the Write procedure of the socket stream. We include such a type in Claw for this very reason. (Putting things into the Clipboard or Registry must be done with a single write, so we have to get all of the bytes together first.) Randy. Randy