Is it possible to have a server and a client with 1 socket connection and send data in both directions at the same time? I mean both the server and the client reads and writes on the same time (2 threads in each process)
Edit: I need “true” two-way communications and not the request / response kind of communication. Both the client and the server must be able to write at the same time.
Edit2: God Dame! It works. Silly me I had a deadlock between client/server because of a write in the reader thread! 🙂 Thanks
TCP connection is a full duplex byte stream, so yes, you can read from and write to the same socket at the same time, though you certainly don’t have to resort to threads to do two-way communication.