Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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

by jmlynesjr (Deacon)
on Sep 29, 2015 at 19:03 UTC ( [id://1143361]=note: print w/replies, xml ) Need Help??


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

I had wanted to share the connection. In the docs I had seen where a reference could be shared, however, I obviously overlooked the "gottcha" that only references to shared scalers are supported. Then I found the doc on shared_clone that seemed to be able to share objects, but it errors also.

The connect, disconnect, and scan threads are being triggered by shared flags set from Wx button events. I could collapse these threads into one connection server thread and run code sections based on the existing flags. I had pondered that earlier today, but was hoping to avoid rewrite #3.

I have a non-threaded version that works except for a sequence of button pushes that gets the state confused because of what seems to be async processing of the Telnet connection error. There is a delay in setting the error flag which the event sub mishandles. Thus this second approach.

Thanks for your response.

James

There's never enough time to do it right, but always enough time to do it over...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-03-29 14:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found