public function read($byte_count=null)
    {

        $this->log('read from  socket');
        $buffer = '';

        if(!is_null($byte_count)) {
        //read the specified amount of data
            $buffer .= fgets($this->socket, 1024);
        } else {
        //read all the data
            while (!feof($this->socket)) {
                $buffer .= fgets($this->socket, 1024);
            }
        }


        return $buffer;
    }
public function read($byte_count=null)
    {

        $this->log('read from  socket');
        $buffer = '';

        if(!is_null($byte_count)) {
        //read the specified amount of data
            $buffer .= fgets($this->socket, 1024);
        } else {
        //read all the data
            while (!feof($this->socket)) {
                $buffer .= fgets($this->socket, 1024);
            }
        }


        return $buffer;
    }
public function read ( $ byte_count = null ) { $ this -> log ( 'read from  socket' ) ; $ buffer = '' ; if ( ! is_null ( $ byte_count ) ) { //read the specified amount of data $ buffer .= fgets ( $ this -> socket , 1024 ) ; } else { //read all the data while ( ! feof ( $ this -> socket ) ) { $ buffer .= fgets ( $ this -> socket , 1024 ) ; } } return $ buffer ; }
Read data from the socket
@param integer $byte_count The amount of data to read, if not set, it reads until feof
@return string The data read from the socket
Read data from the socket