Click here to Skip to main content
16,016,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I am working on a project . I am programming in c# using Visual Studio 2008. It is a Client/Server chat based application. I am sending a class object over TCP for authentication and then UDP for further message passing. Everything works perfectly fine until a client logout . When a client logout I get the following error at the server:

SerializationException was UnHandled
The input stream is not a valid binary format. The starting contents (in bytes) are: 6C-6F-67-6F-75-74-24-61-7A-68-61-72-00-00-00-00-00 ...

The error come at the following line:
Commons.Data tmp = (Commons.Data)bf.Deserialize(ms);

The very same line is also run when the clients are sending messages to each other and it works perfectly fine then.

The following is a screenshot of the :
Console.WriteLine(e.StackTrace);
                    Console.WriteLine(e.Message);
                    Console.WriteLine(e.TargetSite);


The screenshot is at:
http://i48.tinypic.com/2q9g8qx.png[^]

The server keeps running properly even after this exception.
Posted

1 solution

Those bytes are the text string "logout$azhar". So are you attempting to deserialize the logout message from the client?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900