avatar.ds
July 9th, 2006, 12:55 PM
I am writing a client-server application and going to use (at least, initially) the MS built-in BynaryFormatter to exchange messages between client and server. The messages will travel in pair, first a "preview" message, telling the other side which serialized object will come next in the pair, including the byte length of the second serialized object. The "preview" message will be defined as a small class commonly for both client and server, in the common namespace. My concern is, is it enough for the receiving side to calculate this common class' serialized byte length on its own to know how much data to accept from the other side (given it knows for sure that the other side is going to send this class and not anything else)? I.e. is such a problem possible that the same class in the same namespace will be serialized to a different byte length on another machine?