Original Post
I am attempting to send a class from a client to a server, and I seem to be doing something incorrectly. The class name is Points (and it, of course, is serializable), and I declare it in both the server and client. Points is the exact same in the server and client, but it is in each executable, not a separate dll used by each exe. Here is the code in the client and server for the serializing part.
Client:
// clientSockStream is a NetworkStream
Points send_class = new Points();
Stream stream = (Stream) clientSockStream;
BinaryFormatter bformatter = new BinaryFormatter();
bformatter.Serialize(stream, send_class);
clientSockStream.Flush();
Server:
// serverSockStream is a NetworkStream
Points recd = null;
BinaryFormatter bformatter = new BinaryFormatter();
Stream stream = (Stream) serverSockStream;
recd = (Points)bformatter.Deserialize(stream);
serverSockStream.Flush();
When I compile my code, it serializes without and exception and sends apparently with no problem, but when I try to deserialize on the server end, it doesn''t work. Anyone have an idea why this doesn''t work. And as a side note, I can serialize to a file and deserialize back out of it from the client, so I''m pretty sure that end is working.
Jason