src/mg/Ding/Helpers/Tcp/TcpPeer.php
public function read(&$buffer, $length, $peek = false)
    {
        $ret = null;
        if ($this->isConnected()) {
            $length = @socket_recv($this->socket, $buffer, $length, $peek ? MSG_PEEK : 0);
            $ret = $length;
        }
        return $ret;
    }
public function read(&$buffer, $length, $peek = false)
    {
        $ret = null;
        if ($this->isConnected()) {
            $length = @socket_recv($this->socket, $buffer, $length, $peek ? MSG_PEEK : 0);
            $ret = $length;
        }
        return $ret;
    }
Writes to this peer.

@param string  &$buffer Where to put read data.
@param integer $length  Maximum data to read.
@param boolean $peek    True to just take a peek to the data.

@return integer