![]() |
|
Don't ask to ask, just ask | |
PerlMonks |
Re: Design Advice: Reading data from a serial port and writing it to multiple sockets.by submersible_toaster (Chaplain) |
on Sep 24, 2003 at 07:01 UTC ( #293787=note: print w/replies, xml ) | Need Help?? |
Had I been tasked to do this (I'm keen to know what the application) I would consider Thread::Queue. I realise you mention writing a forker, it did not seem clear if that was a requirement or part of 'just-one-of' many possible designs.
A 'serial' thread listens to the tty, dropping incoming data onto a queue. Checks a different queue for information from your socket process (TBD not in your requirements yet). A socket thread controls the multiple socket connections and relays any information arriving in the from-serial-thread queue. As always YMMV :) I can't believe it's not psellchecked
In Section
Seekers of Perl Wisdom
|
|