in reply to Re^4: Socket client thread design problem
in thread Socket client thread design problem
If the hardware is capable fo supporting multiple concurrent connections; then I would suggest using two different connections.
One in a separate, library created thread for the blocking read to receive the hardware-initiated timed and/or event-driven packets.
And the other for client-code initiated, synchronous query/reply transactions.
If the hardware is unable to support two concurrent connections; then I would go for a separate thread with a non-blocking socket and running a typical select with timeout server that checks a queue for pending queries each time the recv timeout expires.
|
|---|