Kinda long title, but anyways...
I\'ve been looking at these examples, specifically on the parts on writing and reading the size of the message to the byte streams
Instead of data.Length
, try:
writer.Write(chr(data.Length) + data);
This will prefix every data block with one byte indicating its length (up to 255 bytes long). As you requested, this is only a nudge. :)
Update: I just remembered that C# is all Unicode and stuff, so chr() probably gives you more than one byte. Adjust to fit.