in reply to Writing a serial-to-Ethernet adapter with Win32::SerialPort
I'd spawn a thread to handle the serialport, and use a Thread::Queue to communicate between that thread and the main thread handling the socket.
You should then be able to use blocking IO on the serial port to provide timely servicing of that without the need to poll.
Using a combination of select on the socket, and $Q->pending() will allow the main thread to manage both the socket and input from the serialport (via the queue) on demand.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Writing a serial-to-Ethernet adapter with Win32::SerialPort
by sgifford (Prior) on May 14, 2004 at 19:33 UTC | |
by BrowserUk (Patriarch) on May 14, 2004 at 20:13 UTC |