Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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??


in reply to Design Advice: Reading data from a serial port and writing it to multiple sockets.

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
  • Comment on Re: Design Advice: Reading data from a serial port and writing it to multiple sockets.

Replies are listed 'Best First'.
Re: Re: Design Advice: Reading data from a serial port and writing it to multiple sockets.
by Anonymous Monk on Sep 26, 2003 at 00:42 UTC
    Thanks so much. A "forker" isn't a requirement it's just that at the time I knew very little about ithreads. Lincoln's book is outdated in that respect but indispensable none the less. I really like your suggestion and I'm going to give it a try. Thanks again!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://293787]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2019-05-21 16:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (136 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!