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,24d7acf9b853aac8 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.78.MISMATCH!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: S-expression I/O in Ada Date: Wed, 11 Aug 2010 18:32:39 +0100 Organization: A noiseless patient Spider Message-ID: References: <547afa6b-731e-475f-a7f2-eaefefb25861@k8g2000prh.googlegroups.com> <46866b8yq8nn$.151lqiwa0y2k6.dlg@40tude.net> <13b07f2c-2f35-43e0-83c5-1b572c65d323@y11g2000yqm.googlegroups.com> <13tpf7ya3evig$.h05p3x08059s$.dlg@40tude.net> <1lhdkikeh2sif.bd3pon3knbv8.dlg@40tude.net> <7027f0c6-d909-428c-ab8d-6ba1bd7ff4b2@x21g2000yqa.googlegroups.com> <1424bzz54867w.soj1iq72wkwl$.dlg@40tude.net> <9db37b80-acbb-4c9f-a646-34f108f52985@v15g2000yqe.googlegroups.com> <16xmnn0qe5yog.ii1p0ap9yuth$.dlg@40tude.net> <5d1d705a-008a-43f1-aa19-9b4878ec926b@m1g2000yqo.googlegroups.com> <1ht6r7gkf2iuw$.55wo4nlr4kxu.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Wed, 11 Aug 2010 17:32:41 +0000 (UTC) Injection-Info: mx03.eternal-september.org; posting-host="KCXegvZb5vh43D+f3BR6Ew"; logging-data="25865"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18DN8lv/TeMHMTJLV7jd79qk7OjQUSE9cc=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin) Cancel-Lock: sha1:f/KdMPSobyYMrQ+YX1nWAwd4Ym4= sha1:NBo7wpL1bVNYXoRCl3TOzua8+O0= Xref: g2news1.google.com comp.lang.ada:13131 Date: 2010-08-11T18:32:39+01:00 List-Id: "Dmitry A. Kazakov" writes: > On Tue, 10 Aug 2010 22:22:02 +0100, Simon Wright wrote: > >> "Dmitry A. Kazakov" writes: >> >>> Yes, if TCP sockets is what you use. There is a hell of other >>> protocols even on the Ethernet, some of which are not stream-oriented. >> >> We leverage stream i/o via UDP (which on GNAT is seriously broken, >> because it tries to do an OS sendto() for each elementary component! > > Wow! Even in the latest GNAT Pro/GPL? > > I am asking because AdaCore fixed this very issue for String'Write, which > did Character'Write per element. Was it String-only fix? There was an efficiency problem, where GNAT did as you say. I raised a ticket but don't recall what happened about it (we are stuck with an archaic GNAT, don't ask). But I think you will still find that a String is still written as a C_Sendto of an Integer (Item'First), another Integer (Item'Last) and then (if this change has been made!) the String itself. Checked in 6.2.2. The best cure IMHO is to refuse to return a Stream for a Datagram_Socket.