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: 103376,8bbf2dbc48e08e2f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!noris.net!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Question about Streams and UDP sockets using GNAT.Sockets Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1153215666.455584.201990@m73g2000cwd.googlegroups.com> <1fpj192j49rf4$.ma23qkoukku3.dlg@40tude.net> Date: Tue, 18 Jul 2006 22:13:00 +0200 Message-ID: NNTP-Posting-Date: 18 Jul 2006 22:12:51 MEST NNTP-Posting-Host: d53bd410.newsread2.arcor-online.net X-Trace: DXC=GE<3;3P`l:l0_l3b[L=KQcQ5U85hF6f;djW\KbG]kaMhGSi?jHD8GO`BAHW44AQeK`[6LHn;2LCVn[ On Tue, 18 Jul 2006 19:07:24 GMT, Jeffrey R. Carter wrote: > Dmitry A. Kazakov wrote: >> >> Don't use String'Write. GNAT implementation treats strings as array so >> characters don't coalesce. It is unexpected, but legal. You might wish to >> define your own type of the packet and implement a suitable write (and >> read) for it. > > Since the language defines String as an array type, it would be strange > to expect anything else. Yet, the language does not prescribe that each element of that array should be written using an individual call to stream's Write. Compare it with an implementation of assignment. The language does not require the compiler to copy each string character individually. It is free to use memcpy. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de