Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

stream doesn't work!

outlawhackeroutlawhacker Posts: 29Member
(sorry about message below. I accidentially pushed return...)

OK. So I have made a DLL-file by choosing Class Library in New Project -> C# projects...
I've put in some variables (int, string, ArrayList...) and then Build Solution.

(the variables are assigned private but with get/set, so they are actually public)

All worked well when I made my classes in the program. I could use the . to get visuals of what variables my class library contained.

But when I try to send it to the server side it can't be done!!
I get contact with server side with the tcpClient...

tcpClient = new TcpClient(ip, port);
mStream = tcpClient.GetStream();
listenThread = new Thread(new ThreadStart(listen));
listenThread.Start();

this works fine! but the next...

(Object object = new Object(); //my class library)

mFormatter.Serialize(mStream, object); //send object to server


(I have added references on both client and server side!)

exception i get:
An unhandled exception of type 'System.Runtime.Serialization.SerializationException' occurred in mscorlib.dll

Additional information: The type Protokoll.NeoProtokoll in Assembly Protokoll, Version=1.0.1238.35808, Culture=neutral, PublicKeyToken=null is not marked as serializable.

does anybody know how to serialize my object??

Comments

Sign In or Register to comment.