Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use threads; use threads::shared; use IO::Socket; my $server = new IO::Socket::INET(LocalHost => 'localhost', LocalPort => 3333, Proto => 'tcp', Listen => SOMAXCONN, Reuse => 1); my %CLIENTS : shared = (); my $clientID : shared = 0; while( my $newClient = $server->accept ) { $clientID++; $CLIENTS{$clientID} = &share($newClient); #<--Error print "hCLIENT: " . $CLIENTS{$clientID} . "\n" }
Code tags added by GrandFather
2006-05-10 Retitled by planetscape, as per Monastery guidelines: one-word (or module-only) titles pose a hazard to site navigation
Original title: 'threads::shared'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to share sockets between threads
by renodino (Curate) on May 10, 2006 at 15:24 UTC | |
|
Re: How to share sockets between threads
by Anonymous Monk on May 10, 2006 at 04:47 UTC | |
by earlati2 (Beadle) on May 10, 2006 at 07:20 UTC | |
by BrowserUk (Patriarch) on May 10, 2006 at 08:04 UTC |