http://www.perlmonks.org?node_id=1006845


in reply to Pass a IO::Socket handle to a thread

I don't know about the code you posted, but to pass a handle to a thread, use the fileno of the handle.
# some pseudo code my $fileno = fileno($fh); threads->create( \&thread, $fileno )->detach; sub thread{ my( $fileno ) = @_; open my $fh, ">&=$fileno" or warn $! and die; print $fh "thread# ",threads->tid()," -> $fileno \n" ; }

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

Replies are listed 'Best First'.
Re^2: Pass a IO::Socket handle to a thread
by Anonymous Monk on Dec 03, 2012 at 11:22 UTC