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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.236.94.113 with SMTP id m77mr5113076yhf.33.1390574679767; Fri, 24 Jan 2014 06:44:39 -0800 (PST) X-Received: by 10.140.43.74 with SMTP id d68mr26596qga.8.1390574679749; Fri, 24 Jan 2014 06:44:39 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!f11no2539728qae.1!news-out.google.com!gg4ni2016qab.0!nntp.google.com!k15no2523207qaq.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 24 Jan 2014 06:44:39 -0800 (PST) In-Reply-To: <14k7gbu5ws82b.3pn20kh5ci50.dlg@40tude.net> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=81.166.54.34; posting-account=bXa9kQoAAADQ0LSY80qTyLW4hcbm0Soz NNTP-Posting-Host: 81.166.54.34 References: <20a36d96-850e-4020-8dfa-777eb9c944f4@googlegroups.com> <9e27abb7-e944-4bd4-a10c-600fe4da7872@googlegroups.com> <56a5aeb6-8704-457c-a24f-b664746afe72@googlegroups.com> <13pvagjpwejni$.1e8ll5btxg1f5$.dlg@40tude.net> <5bf8c737-b99d-4069-885f-03fe82f06cc6@googlegroups.com> <14k7gbu5ws82b.3pn20kh5ci50.dlg@40tude.net> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Binary and XML serialization of types From: hanslad@gmail.com Injection-Date: Fri, 24 Jan 2014 14:44:39 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Received-Bytes: 2850 X-Received-Body-CRC: 2795632711 Xref: news.eternal-september.org comp.lang.ada:18285 Date: 2014-01-24T06:44:39-08:00 List-Id: > > In the case 2, you should consider using packets instead of a raw octet > > stream. Typically you would form an outgoing packet in the memory, using > > whatever means (e.g. by a string-mapped stream) and then send the packet > > out as a whole. It is especially important to do if you are going to use > > NO_DELAY socket option. > > This sounds interesting. Do you know any good examples of this? > > Is it a custom protocol you are going to invent? Anyway, the protocols > > usually deploy some sort of packet header to describe the request and the > > body of. The most efficient way is when the body length can be determined > > from the header. You read the body into memory and then parse it, e.g. > > using a string-mapped stream. > The protocol is certanly not invented by me(OPC UA), but I want to implement it in Ada as a long term hobby project. The base types(int, IEEE-754 float) is encoded with the least significant byte appearing first (i.e. little endian). > > > For me it would be locical to separate all the "wire information" from the > > > type information. Today, the binary and xml encoding scheme is defined, > > > and I had hope to be able to separate this in different packages. > > > > That is doable. > A simple example would be great! As a total Ada beginner, any code examples or references to it will help me alot. Thanks HP