I am writing a Sivlerlight Chat application using Sockets and the DataContractSerializer.
I have a class hierarchy of serializable objects with the definitions shared between the Silverlight Client and the C# Server.
When a buddy logs on they send a message to the server and if they are verified they are sent an acknowledgment followed by several messages which tell them who else is online (and some other messages as well). The client then waits on the socket and ready bytes off of it. It will then try to deserialize the objects off of the resulting byte stream. However because the server has sent several messages the byte stream will contain the xml for more than one element and when it is deserialized a Multiple root exception is thrown.
What is the standard solution for deserializing a stream of objects off of a Socket using the DatacontractSerializer?
Thanks