in reply to Re^4: Using read/syswrite with IO::Socket::SSL
in thread Using read/syswrite with IO::Socket::SSL

->can_read(0) will only return handles that have been set into the IO::Select object. Only set those you are interested in.

BTW, from the fragment you gave, $sock is your listen socket and is only used for accepts. $client_sock is your read/write socket.

typical code fragment:

for my $handle ( $sel->can_read(0) ) { if( $handle == $sock ) { # do accepts here... } elsif( $handle == $client_sock ) { # do sysreads here... } }