in reply to Difference between can_read() and select() in IO::Select
. So you will see pseudo logic like:
the problem comes with making the select work in a bi-directional manner, usually a forking server and or client is used so the socket can both send and recv simultaneously. If both client and server are set to either send or recv, it locks up the socket.while( my $sel = $select->can_read ){ if($sel->accept){spawn a new connection maybe by forking/threading or addi +ng to the select array } if( $sel->is_connected){ #check for connection status if ($sel->can_write){ etc } } }
|
|---|