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...


In reply to Re^2: How do you share an object(Telnet Session) between threads? by jmlynesjr
in thread How do you share an object(Telnet Session) between threads? by jmlynesjr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.