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!news2.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!news-zh.switch.ch!switch.ch!cern.ch!news From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Various Language Architecture Questions Date: Mon, 26 Sep 2005 09:44:46 +0200 Organization: CERN - European Laboratory for Particle Physics Message-ID: References: <1127615832.540718.246970@g43g2000cwa.googlegroups.com> <1lj1ewtykmmp4.j6srtz43enc4.dlg@40tude.net> <1127652977.471484.203180@g47g2000cwa.googlegroups.com> NNTP-Posting-Host: abpc10883.cern.ch Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sunnews.cern.ch 1127720685 15437 (None) 137.138.37.241 X-Complaints-To: news@sunnews.cern.ch User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050913 Red Hat/1.7.10-1.4.2.SL3 X-Accept-Language: en-us, en In-Reply-To: <1127652977.471484.203180@g47g2000cwa.googlegroups.com> Xref: g2news1.google.com comp.lang.ada:5156 Date: 2005-09-26T09:44:46+02:00 List-Id: frankgerlach@gmail.com wrote: > Whatabout the following examples: > 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. I guess that the time spent on the protocol stack and in all the network equipment is much bigger than what is needed to construct a correct packet, so being "fast" here is just a premature optimization. Sending C structs by pointer+sizeof is asking for trouble, even if you accept it to be non-portable. I prefer careful packet composition. -- Maciej Sobczak : http://www.msobczak.com/ Programming : http://www.msobczak.com/prog/