public function select($timeout = 0) {
        $read = [$this->socket];
        $write = null;
        $except = null;

        $sec = floor($timeout / 1000);
        $usec = $timeout % 1000;
        if($this->socketsEnabled) {
            $select = socket_select($read, $write, $except, $sec, $usec);
        } else {
            $select = stream_select($read, $write, $except, $sec, $usec);
        }

        return $select > 0;
    }