in reply to Re: Threaded Sockets, access from outside thread?
in thread Threaded Sockets, access from outside thread?

$controlSocket is declared globally uptop, and then is configured in the sub commandPath to initiate the socket to the master server.
Even though I declared it globally, I can't access it from outside the thread.
Unless you're seeing something else and I'm misinterpreting what you're saying?
  • Comment on Re^2: Threaded Sockets, access from outside thread?

Replies are listed 'Best First'.
Re^3: Threaded Sockets, access from outside thread?
by ikegami (Patriarch) on Jun 16, 2006 at 05:44 UTC

    I think he means
    my $controlSocket;
    should be
    my $controlSocket :shared;
    Variables aren't automatically shared.

      Thanks
      I tried that before, but ended up getting:
      thread failed to start: Invalid value for shared scalar at server_clie +nt_thread.pl line 41. thread failed to start: Invalid value for shared scalar at server_clie +nt_thread.pl line 59. for lines: $controlSocket = IO::Socket::INET->new("localhost:1024") or pr +int "Can`t open feed\n"; and $server = IO::Socket::INET->new( Proto => 'tcp',
      If the shared call is right, should I be declaring the socket calls differently?