Lee Jenkins wrote:
> Hi all, which is the best way to receive packets from a tcp server when there 
> is 
> no explicit terminator to signal the end of the packet?  I have to connect to 
> and get a packet from a server that was written in VB and I think their using 
> the winsock control that comes with that and do no send a terminate at the 
> end 
> of the string.

Umm... if there is no explicit terminator, I guess there is an implicit 
one (as otherwise, there'd be no way whatsoever to determine when the 
package is ready to be handled). Of course; if the "package" contains 
first a header of sorts that informs the length of the package, you can 
only read the header part until you know how long the package is, and 
after that read the length of package minus the length already read.

Without knowing more about the datastructure in question, this is of 
course nothing but guessing :)

-- 
Markku Uttula

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
synalist-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to