Serialization over sockets
Hi, I'm new to the forums. I've been searching through posts for an answer to my question, but have not had any luck as of yet. So i guess i will get to it.
Is it possible to identify whether a "write" (message) sent over a socket is a simple string message (for instance "SERVER:LOCK"), or a serialized object? Also, if this is possible, would I be able to identify of what class the object is without first sending a message with a description. (For instance, first sending "SERVER:<type-of-class-comming-next>", and then sending the actual serialized object)
I have written a small chat client which relies on a server running on my computer. (Multi-threaded, allowing multiple clients to chat with each other). I would like to implement a text pane which would be viewable and editable by all parties connected, kind of like paired programming over a network. At the moment I am only concerned about 2 people having access to the same text (i limit connections through the server to 2). I have been succesfull at controlling the clients windows, by sending specialized messages ("SERVER:LOCK") to server and deciphering them on the client end. Basically one person can edit inside the window at a time. But as for updating the text contained inside the window, this is my problem.
I am not an expert software engineer, I am still a student in college, but am considering using Object Serialization to send the aforementioned text to and from. But, i am wondering if I can use the same socket to do all data transfer and messages, or if i will need to run object transfer on a separate socket (controlled by separate threads to cut down response time).
I hope i am being clear enough, I do not have any running code that sends my desired objects back and forth. I was just kind of curious how real-world software engineers would handle the situation.