IO-Socket-SSL - Segmentation fault when I use client socket in a subroutine

Posted on Fri Mar 9 21:41:06 2007 by jesus144
Segmentation fault when I use client socket in a subroutine
Good evening,
I have a script which work properly with a IO::Socket::INET. I'm trying to encrypt the communication using IO::Socket::SSL. After socket building, I wait for a connection with:

while (my $sock = $server->accept()) { print ">New connection\n"; threads->new( \&perform, $sock, $self); }

When the perform method runs, I can not access to $sock without having a Segementation Fault (then the script crash). The code of my subroutine is clean, if I replace subroutine call by the code, everything works properly... It really seems to be a problem passing the socket to the perform method.
How can I pass the socket to the subroutine???
Thank you very much :-)
Direct Responses: 4939 | Write a response