You are here

function Net_Socket::readInt in Flickr API 5

Reads an int of data

@access public

Return value

integer 1 int of data from the socket, or a PEAR_Error if not connected.

File

phpFlickr/PEAR/Net/Socket.php, line 379

Class

Net_Socket
Generalized Socket class.

Code

function readInt() {
  if (!is_resource($this->fp)) {
    return $this
      ->raiseError('not connected');
  }
  $buf = @fread($this->fp, 4);
  return ord($buf[0]) + (ord($buf[1]) << 8) + (ord($buf[2]) << 16) + (ord($buf[3]) << 24);
}