how to share socket handle across threads?

Discussion in 'Perl Misc' started by Sebastien, Jul 7, 2003.

  1. Sebastien

    Sebastien Guest

    Hello,

    I've been rtfm'ing for days but can't a solution to this problem:

    I have a thread that receives multiple client request thanks to an
    endless loop through the accept() method. The new socket object
    returned by accept() must be communicated to another master thread. I
    am using the IO::Socket module.

    When trying to use threads::shared or Thread::Queue, I keep getting
    this failure:
    Invalid value for shared scalar at ./X.pl line N.

    So is there a way to share a socket/file handle accross threads?

    Thank you

    Sebastien
     
    Sebastien, Jul 7, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Laszlo Nagy
    Replies:
    1
    Views:
    5,016
    Mark Wooding
    Jan 27, 2009
  2. Jean-Paul Calderone
    Replies:
    0
    Views:
    1,014
    Jean-Paul Calderone
    Jan 27, 2009
  3. Laszlo Nagy
    Replies:
    0
    Views:
    584
    Laszlo Nagy
    Feb 1, 2009
  4. Steve Holden
    Replies:
    0
    Views:
    699
    Steve Holden
    Feb 1, 2009
  5. Saraswati lakki
    Replies:
    0
    Views:
    1,390
    Saraswati lakki
    Jan 6, 2012
Loading...

Share This Page