I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2007-03-09 19:41:06-08 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
Posted on 2007-04-20 12:07:33-07 by noxxi in response to 4534
Re: Segmentation fault when I use client socket in a subroutine
IO::Socket::SSL is not thread safe. From the IO::Socket::SSL manpage:
| IO::Socket::SSL is not threadsafe. This is because IO::Socket::SSL is based on Net::SSLeay | which uses a global object to access some of the API of openssl and is therefore not | threadsafe.
Direct Responses: Write a response