public function startClose($code = self::CLOSE_NORMAL, $reason = '')
    {
        if ($this->state < self::STATE_CLOSING) {
            $code  = intval($code);
            $data  = pack('s', $code) . $reason;
            $frame = new Net_Notifier_WebSocket_Frame(
                $data,
                Net_Notifier_WebSocket_Frame::TYPE_CLOSE
            );

            $this->send($frame->__toString());

            $this->state = self::STATE_CLOSING;

            $this->shutdown();
        }
    }