develooper Front page | perl.beginners | Postings from April 2010

Thread Queues and Sockets

From:
Iker Perez de Albeniz Villarroel
Date:
April 13, 2010 04:33
Subject:
Thread Queues and Sockets
Message ID:
D5F079D55747964ABD3A2A3E2B02C0330248CC80@ESLABEXH02.pandasoftware.local
Hi,

 

I am having problems creating a multithread queued Server because i can
not enqueue sockets..

 

For example is not possible to make something like this..

 

my $Qwork = new Thread::Queue;

our $server = new Net::SMTP::Server($host) || 

while(my $conn = $server->accept()) {

    $Qwork->enqueue($conn)

}

 

 

Because $conn is not a shared object and can not be shared.. so
searching in google I have found a way to  do this using fileno function
and engueuing the fileno of this socket and then reopening the socket
using the fileno but does not work for me...

 

Is there an other way to do this easily?




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About