sub read { my $socket = shift; my $timeout = shift || 60; return undef unless( _is_valid( $socket ) ); my $hash; local $@ = ''; my $select = IO::Select->new( $socket ); while( $timeout-- ) { last unless _is_valid( $socket ); if( $select->can_read( 1 ) ) { eval{ $hash = fd_retrieve( $socket ); }; return $@ ? undef : $hash } } return undef; }