C
cold
I'm trying to write an helper class that allows me to serialize objects to a
socket (or a NetworkStream). I know there are plenty of .NET classes that
help me to serialize object to an array of byte, but I can't undestand how I
can send a block of bytes and being sure the receiver will receive only this
block....I mean, if I write the bytes to a NetworkStream the receiver will
get a stream of bytes and he won't have any way to know how to "split" the
data. Am I supposed to build a protocol, using a special byte to mark the
beginning and the end of every "message" (in this case I should stuff the
bytes before sending)?
I hope I've explained well what I would like to do
Thank you for your help
Seba
socket (or a NetworkStream). I know there are plenty of .NET classes that
help me to serialize object to an array of byte, but I can't undestand how I
can send a block of bytes and being sure the receiver will receive only this
block....I mean, if I write the bytes to a NetworkStream the receiver will
get a stream of bytes and he won't have any way to know how to "split" the
data. Am I supposed to build a protocol, using a special byte to mark the
beginning and the end of every "message" (in this case I should stuff the
bytes before sending)?
I hope I've explained well what I would like to do
Thank you for your help
Seba