We're building an async thread per client server and stumbled upon a problem. We want the thread to always be ready to either read or write to\from the socket. We currently use the socket's reading method which is blocking and as a result we cannot issue any write requests.
- is there a way to interrupt the read operation?
- perhaps it's better to have the main server thread responsible for writing to the socket?
if so, does it still comply with the thread per client design pattern?