G
Guest
I'm trying to serialize an object across a tcp connection. I have the
foundation all set and now I'm trying to accomodate objects that might be
bigger than the receive buffer. So I figured I'd just use the serialization
header to hold some info about the size of the object and if it's got more
than one part. Then stream all the parts of an object into a single
MemoryStream and then deserialize the whole lot.
But when I started to implement it, I realized there were a few issues.
First, the Header array needs to be created before you serialize the object.
So I don't really have any way to check the size of the serialized object
beforehand, unless I serialize it twice. Once to check the size, and then
again to send it along with the header info that I populate once I know the
size fo the object.
Basically, I'm just looking for advice on how to handle objects bigger than
an expected receive buffer. How can I break them up and reassemble them on
the other side?
Thanks.
foundation all set and now I'm trying to accomodate objects that might be
bigger than the receive buffer. So I figured I'd just use the serialization
header to hold some info about the size of the object and if it's got more
than one part. Then stream all the parts of an object into a single
MemoryStream and then deserialize the whole lot.
But when I started to implement it, I realized there were a few issues.
First, the Header array needs to be created before you serialize the object.
So I don't really have any way to check the size of the serialized object
beforehand, unless I serialize it twice. Once to check the size, and then
again to send it along with the header info that I populate once I know the
size fo the object.
Basically, I'm just looking for advice on how to handle objects bigger than
an expected receive buffer. How can I break them up and reassemble them on
the other side?
Thanks.