in reply to Non-blocking sockets with Net::Server and SSL
> STDIN->blocking(0);
That part is the problem. Net::Server tries to handle SSL in a special way but this way is not working with the code you use. The blocking(0) will not be done on the socket to the client, but instead on fd 0 which is at this moment /dev/null. Thus it will not have the desired effect.
One way to deal with the problem is to reach into the internals of Net::Server to get access to the real file descriptor behind STDIN:
tied(*STDIN)->[0]->blocking(0);A better way is to use the file descriptor which is given to the process_request function:
sub process_request {
my ($self,$fd) = @_;
$fd->blocking(0);
In both variants the real socket will be set non-blocking.
Apart from that, note that the SSL handshake will still be done blocking by Net::Server.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Non-blocking sockets with Net::Server and SSL
by cavac (Prior) on Apr 09, 2015 at 21:22 UTC |