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 Path: border1.nntp.dca1.giganews.com!nntp.giganews.com!newspeer1.nac.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Questions about socket programming Date: Tue, 13 Jan 2015 09:53:24 +0100 Organization: cbb software GmbH Message-ID: References: <%pzmw.361295$Mq4.223465@fx25.iad> <1vt5kszrayia0$.18j888endc4qm.dlg@40tude.net> <3sb8ba1api5dg7ip82n56n34oa0hi5pv5s@4ax.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: YGNMlxhiQ90vAyH0QA4qPw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: number.nntp.giganews.com comp.lang.ada:191867 Date: 2015-01-13T09:53:24+01:00 List-Id: On Mon, 12 Jan 2015 20:31:46 -0800, Hubert wrote: > Thanks, thats a valuable hint. I am not very experienced in socket > programming, for my main work I use a network library that takes care of > all this on a higher level, so low level sockets provide some surprises > for me No library can take care unless it understands protocol framing. The point is that TCP/IP sockets do not have visible framing. Except for one important case when the NO_DELAY socket option is set. Normally the TCP/IP stack splits outgoing stream into frames as it finds appropriate. Furthermore the content source is not required to call a send for each frame. Single send may cause several frames sent and conversely several sends can coalesced into one frame. So whatever logical framing may be present, it always comes from the higher-level protocol running over TCP/IP transport. E.g. in the case of Telnet it would be lines, CR-LF terminated, if I correctly remember. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de