Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: Pass a IO::Socket handle to a thread

by zentara (Archbishop)
on Dec 03, 2012 at 10:44 UTC ( #1006845=note: print w/replies, xml ) Need Help??

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1006845]
[marto]: if we had a bigger team I would, but we're very small, and I want to get this done and move on to better things
[Discipulus]: marto jack of all trade!
Discipulus poloutropon in ancient greek iirc
[marto]: yeah, master of none
Discipulus πολϋθροπο ν
Discipulus boring meeting time.. see you

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2017-03-29 09:14 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (344 votes). Check out past polls.