in reply to Threaded Sockets, access from outside thread?
threads won't allow you to share blessed objects directly, and IO::Socket handles are blessed globs. The only workaround that I've discovered so far is to share the fileno of sockets that you wish to use from multiple threads (which Perl sees as simple scalars), and then use this to dup the socket into other threads that need to access the socket.
See Re: FileHandles and threads & Re: multithreaded tcp listener with IO::Socket and associated subthreads for some background and detail.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Threaded Sockets, access from outside thread?
by ecuguru (Monk) on Jun 19, 2006 at 01:38 UTC |