In a nutshell, use a single thread for communicating with your serial port. Set up two Thread::Queues: one for inbound commands; one for outbound responses.
When one of your clients sends a command, post it to the inbound queue.
Have your another thread monitor the outbound queue and forward a copy of each thing it dequeues to every connected client.
In reply to Re^5: TCP Socket and Serial Port
by BrowserUk
in thread TCP Socket and Serial Port
by FlyingEagle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |