How do I both read and write a socket?
807588Apr 1 2009 — edited Apr 1 2009Hello,
So, I am working on a server - client system and I am having a problem figuring out how to do this.
-The client connects to the server, where a thread is created for the connection.
-An initial exchange of data happens.
-After exchange, the connection remains open so that login status and such is saved and associated with the connection.
-The connection sits idle until either the client or the server have something to say, and start a new exchange of data.
The problem that I am having is that both the client and server have to sit at a read to wait for the other to start a communication, but while waiting at read, the thread is blocked.
Thanks in advance for any advice.