public function setBlocking($blocking)
    {
        if ($this->blocking == $blocking) {
            return;
        }

        if ($blocking) {
            if (@socket_set_block($this->socket) === false) {
                $this->throwSocketError();
            }
            $this->blocking = true;
        } else {
            if (@socket_set_nonblock($this->socket) === false) {
                $this->throwSocketError();
            }
            $this->blocking = false;
        }
    }