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: Brian Rathbone <brianrathbone@bellsouth.net>
Date: Thu, 26 Feb 2009 16:48:37 -0500
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
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)
For protocols that use a CRLF (or other character) terminated command, I usually use instr and lookahead to check for CRLF, and then loop through the data and parse out individual commands while ignoring any partial commands. It looks something like this:

 i = instr(me.lookahead,terminator)
 while i > 0
'//read data up to i from socket '//parse out command and do stuff '//since we read data up to i, lookahead is only looking at data left in the buffer
  '//look for another terminator
   i = instr(me.lookahead,terminator)
 wend

hope that makes good sense.

Brian Rathbone
<http://www.brianrathbone.com>
The Dawning of Power fantasy trilogy is now available through iTunes for iPhone and iPod Touch
<http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=305606493&mt=8>


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?

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? Hmm, probably, for optimization reasons.

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


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

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


From  Thu 26 Feb 2009 22:56:21 +0100
Delivered-To: listarchive@realsoftware.com
Received: by 10.100.124.16 with SMTP id w16cs106320anc;
       Thu, 26 Feb 2009 13:57:28 -0800 (PST)
Received: by 10.224.89.74 with SMTP id d10mr3025507qam.202.1235685447982;
       Thu, 26 Feb 2009 13:57:27 -0800 (PST)
Return-Path: <realbasic-nug-bounces@lists.realsoftware.com>
Received: from advanced107.inmotionhosting.com (advanced107.inmotionhosting.com 
[74.124.194.228])
       by mx.google.com with ESMTP id 26si1400372qyk.164.2009.02.26.13.57.27;
       Thu, 26 Feb 2009 13:57:27 -0800 (PST)
Received-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) client-ip=74.124.194.228;
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
Received: from localhost ([127.0.0.1] helo=advanced107.inmotionhosting.com)
        by advanced107.inmotionhosting.com with esmtp (Exim 4.69)
        (envelope-from <realbasic-nug-bounces@lists.realsoftware.com>)
        id 1LcoDP-0006rq-5o; Thu, 26 Feb 2009 13:56:23 -0800
Received: from smtprelay09.ispgateway.de ([80.67.29.23])
        by advanced107.inmotionhosting.com with esmtp (Exim 4.69)
        (envelope-from <realbasiclists@monkeybreadsoftware.de>)
        id 1LcoDO-0006ri-8T for realbasic-nug@lists.realsoftware.com;
        Thu, 26 Feb 2009 13:56:22 -0800
Received: from [84.175.82.211] (helo=[192.168.1.80])
        by smtprelay09.ispgateway.de with esmtpa (Exim 4.68)
        (envelope-from <realbasiclists@monkeybreadsoftware.de>)
        id 1LcoDN-0004Nq-HS for realbasic-nug@lists.realsoftware.com;
        Thu, 26 Feb 2009 22:56:21 +0100
To: realbasic-nug@lists.realsoftware.com (REALbasic NUG)
Subject: Take a look on the ChartDirector5 plugin
From: realbasiclists@monkeybreadsoftware.de (Christian Schmitz)
Date: Thu, 26 Feb 2009 22:56:21 +0100
Message-ID: <1ivrovl.1x3u5bxl7yasbM%realbasiclists@monkeybreadsoftware.de>
User-Agent: MacSOUP/D-2.8.2 (Mac OS X version 10.5.6 (x86))
X-Df-Sender: 363246
X-BeenThere: realbasic-nug@lists.realsoftware.com
X-Mailman-Version: 2.1.10
Precedence: list
Reply-To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: realbasic-nug-bounces@lists.realsoftware.com
Errors-To: realbasic-nug-bounces@lists.realsoftware.com
X-AntiAbuse: This header was added to track abuse, please include it with any 
abuse report
X-AntiAbuse: Primary Hostname - advanced107.inmotionhosting.com
X-AntiAbuse: Original Domain - realsoftware.com
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - lists.realsoftware.com

Hi,

A big update is coming to our ChartDirector plugin in the next weeks.

The code is already written, the examples are done and you can test it.
The library is not yet final, so the plugin will still need time and may
contain bugs. Also the Financial Chart class is now included in the
plugin.

Take a look on some screenshots here:

http://discussion.monkeybreadsoftware.de/viewtopic.php?f=40&t=191&p=487

Watch the video here:

http://www.monkeybreadsoftware.de/realbasic/movies/ChartDirector5.shtml

and download the 9.2pr4 plugins here to try one of the over 150 examples
yourself:
http://www.monkeybreadsoftware.de/realbasic/plugin/Prerelease/

Feedback is welcome!

Greetings
Christian

--
Over 1100 classes with 22000 functions in one REALbasic plug-in. The Monkeybread Software Realbasic Plugin v9.0.
<http://www.monkeybreadsoftware.de/realbasic/plugins.shtml>

_______________________________________________
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>