realbasic-nug
[Top] [All Lists]

Re: TCP packet - are separate packets collected into one?

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: TCP packet - are separate packets collected into one?
From: Norman Palardy <npalardy@great-white-software.com>
Date: Thu, 26 Feb 2009 13:14:52 -0700
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <89fe53800902261201u4d7703d7s5a7f9edeab9bad45@mail.gmail.com>
References: <89fe53800902261201u4d7703d7s5a7f9edeab9bad45@mail.gmail.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com

On 26-Feb-09, at 1:01 PM, Thomas Tempelmann wrote:

I've never been clear on this one, and I wonder if someone KNOWS how
this works with REALbasic's sockets:

If I make two separate Write() calls to a socket, will the receiving
side receive two Strings when calling ReadAll in a loop, or might it
get one String containing both packets concatenated?

depending on how big the strings are they might read a part of one with each call
or two concatentated together if they are small

Or is that actually a property of the TCP transport itself, that it
may choose to collect several small data segments and send them all at
once?

yes

Hmm, probably, for optimization reasons.

yes

Meaning I can see a TCP socket only as a stream transport, not as a
packet transport as it is with UDP, right?

it's a stream

this is one reason you need some kind of framing in your protocol

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>