Andrew Keller wrote:

> I am having a bit of trouble with some TCP transmissions.  Every once  
> in a while, a transmission is received that is not decoded properly  
> by my parsing subroutine.  It usually works fine.  I didn't think  
> about it very much until I noticed that sometimes, the dictionary  
> that is built from the transmission (my transmission parsing  
> subroutine returns a dictionary) is incomplete.

Yep, sounds to me like you're assuming that you've got a complete message when 
DataAvailable fires.  That's not necessarily the case.

> Is a TCP socket only supposed to fire DataAvailable when it gets a  
> complete transmission, or does it fire for every packet?

It fires whenever there happens to be some data available when the socket code 
happens to check for that.  It has no relationship whatsoever to whether that 
data represents a complete "transmission" (whatever that means in your 
protocol).

> Should I create my own buffer and put markers at the beginning and end of the 
>  
> transmission so that I know when it completes?

Yes, that (or something equivalent) is absolutely necessary.  Or, use 
EasyTCPSocket, which does that for you.

Best,
- Joe

--
Joe Strout -- [EMAIL PROTECTED]
Verified Express, LLC    "Making the Internet a Better Place"
http://www.verex.com
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to