I'm working on a program that needs to transmit some information to a remote server for processing. I have packaged the two objects into a byte stream, but seem to be having trouble figuring out how to send both of them.
There are a lot of great examples out there for sending data using sockets and TcpClients, howerver I haven't seen any that demonstrate sending different types of data, and decyphering them on the other end.
For example, I have Object A, and Object B that I need to send. I can successfully send Object A, or Object B, but not both. I've tried sending them one after the other but seem to run into issues with the socket closing on me after the first one, and I've also tried sending both as a big byte array, but got stuck on the other end trying to figure out how to find the seperation between object A and Object B.
Does anyone have any good best practices for 'continued communications?' (I'm guessing at the name...I'm not entirely sure what this would be considered. Is it better to use a networkstream with a socket, or tcpclient? Any help or examples would be greatly appreciated.