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,2cc84c0fee9046c0 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!LF.net!news.enyo.de!not-for-mail From: Florian Weimer Newsgroups: comp.lang.ada Subject: Re: Various Language Architecture Questions Date: Mon, 26 Sep 2005 23:05:21 +0200 Message-ID: <87slvrzgj2.fsf@mid.deneb.enyo.de> References: <1127615832.540718.246970@g43g2000cwa.googlegroups.com> <1lj1ewtykmmp4.j6srtz43enc4.dlg@40tude.net> <1127652977.471484.203180@g47g2000cwa.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: albireo.enyo.de 1127768745 22326 212.9.189.177 (26 Sep 2005 21:05:45 GMT) X-Complaints-To: Cancel-Lock: sha1:vXcx/USMtMnHFJugIMZFuFZE6Dg= Xref: g2news1.google.com comp.lang.ada:5166 Date: 2005-09-26T23:05:21+02:00 List-Id: > 1.) Simple,unportabe Network Data Transport: To transport a C struct, I > just cast it to char* and then write sizeof(myStruct) bytes to the > Socket. This is very fast and works in a homogeneous network. The speed gain is usually not worth the portability loss. If you have to copy the data just once (as it is common with stream-oriented data transmission), it's possible to get proper marshaling almost for free. (There are template metaprogramming libraries which can do this for C++. For Ada, you'd need a little code generator.)