Beefy Boxes and Bandwidth Generously Provided by pair Networks
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 ( [id://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

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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://293787]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-03-28 23:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found