simplified the message sending process with object serialization over a socket