Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: How do you share an object(Telnet Session) between threads?

by locked_user sundialsvc4 (Abbot)
on Sep 30, 2015 at 05:21 UTC ( [id://1143383]=note: print w/replies, xml ) Need Help??


in reply to How do you share an object(Telnet Session) between threads?

As BrowserUK ably suggests, when a thread is dedicated to the care-and-feeding of any external resource or host connection, it can be reliably programmed to deal with any eventuality, and to always know the state of that connection.   Even if you decided to open multiple telnet sessions, I would still have a controller-thread (instance ...) dedicated to each one, which accepted requests and delivered results using thread-safe queues.   A finite-state machine (FSM) is an excellent design for this piece.   A second queue can be used to communicate status to the parent thread, analogous to the separate STDERR output-stream of an ordinary Unix process.

Replies are listed 'Best First'.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2026-02-15 05:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.