public function ping($payload = null)
    {
        if ($payload === null) {
            $payload = microtime(true);

        } elseif (isset($payload[125])) { //Much faster than strlen($payload) > 125
            throw new LengthException("Ping payload cannot be larger than 125 bytes");
        }

        $this->currentPingFrame = new DataFrame($this->logger);
        $this->currentPingFrame->setOpcode(DataFrame::OPCODE_PING);
        $this->currentPingFrame->setPayload($payload);
        $this->pushData($this->currentPingFrame);

        return $payload;
    }