Limit on TCP Stream or String?

BlitzMax Forums/BlitzMax Programming/Limit on TCP Stream or String?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I think your problem is with the following line
If Buffer.Length >= s.Length And Right$(Buffer,s.Length) = s Then 


I'm assuming your stop sequence is either ~r~n or ~0, right? Well, the problem with that piece of code is that it's only comparing the end of the buffer to see if it matches the stop sequence. The thing is, the original message may be getting split into multiple packets such that your ~r~n or ~0 are ending up in the middle of the packet - therefore they'll be in the middle of your buffer and the above test will fail and the stop sequence won't be found or replaced.

Why don't you try changing the if to the following
If( Buffer.Find( StopSeq, 0 ) )

Local t:String = Buffer.Replace(s,"") 'Strip out the Stop sequence

Return t

End If


I might very well be wrong, but it's the only thing I can think of at the moment.