die "read timeout" if $timeout && !$sel->can_read($timeout); $n = $socket->sysread($buf, $size, length($buf));