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,24d7acf9b853aac8 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!newsfeed.straub-nv.de!news.musoftware.de!wum.musoftware.de!news.weisnix.org!newsfeed.ision.net!newsfeed2.easynews.net!ision!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: S-expression I/O in Ada 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: <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> Date: Wed, 11 Aug 2010 19:53:03 +0200 Message-ID: NNTP-Posting-Date: 11 Aug 2010 19:53:02 CEST NNTP-Posting-Host: c0c8ddbf.newsspool4.arcor-online.net X-Trace: DXC=jYh055S4g5XYQ5E:lni48ZC2Sj[ X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:13137 Date: 2010-08-11T19:53:02+02:00 List-Id: On Wed, 11 Aug 2010 18:32:39 +0100, Simon Wright wrote: > "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. We never used the stream interface with TCP sockets either. Socket stream is certainly a nice-to-have feature, but, I don't know, we didn't even considered to use it. Somehow it was out of question from the start. Otherwise, we would have noticed it, since we are doing a lot of heavy-duty TCP and UDP stuff over GNAT.Sockets. In the beginning we a bit suspicious and considered a possibility to use another socket library, but GNAT.Sockets worked so well that we dropped the idea. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de