Skip to content

PhpOrient Protocols Binary OrientSocket

Domenico Lupinetti edited this page Jan 1, 2015 · 3 revisions

PhpOrient\Protocols\Binary\OrientSocket

  • Class name: OrientSocket
  • Namespace: PhpOrient\Protocols\Binary

Constants

CONN_TIMEOUT

    const CONN_TIMEOUT = 5

READ_TIMEOUT

    const READ_TIMEOUT = 30

WRITE_TIMEOUT

    const WRITE_TIMEOUT = 10

Properties

$connected

    public boolean $connected = false
  • Visibility: public

$protocolVersion

    public integer $protocolVersion = \PhpOrient\Configuration\Constants::SUPPORTED_PROTOCOL
  • Visibility: public

$_socket

    public resource $_socket

The socket resource

  • Visibility: public

$hostname

    public string $hostname = ''

Server host address

  • Visibility: public

$port

    public integer $port = -1

Server port

  • Visibility: public

Methods

__construct

    mixed PhpOrient\Protocols\Binary\OrientSocket::__construct(string $hostname, integer $port)
Create and open the socket.
  • Visibility: public
Arguments
  • $hostname string

    The host or IP address to connect to.

  • $port integer

    The remote port.

connect

    \PhpOrient\Protocols\Binary\OrientSocket PhpOrient\Protocols\Binary\OrientSocket::connect()
Gets the OrientSocket, and establishes the connection if required.
  • Visibility: public

getErr

    string PhpOrient\Protocols\Binary\OrientSocket::getErr()
Get Error from socket resource
  • Visibility: public

__destruct

    mixed PhpOrient\Protocols\Binary\OrientSocket::__destruct()
Destroy the socket.
  • Visibility: public

read

    string PhpOrient\Protocols\Binary\OrientSocket::read(integer $size)
Read a number of bytes from the socket.
  • Visibility: public
Arguments
  • $size integer

    The number of bytes to read, defaults to the socket's bufferSize.

write

    mixed PhpOrient\Protocols\Binary\OrientSocket::write(mixed $bytes)
Write some bytes to the socket.
  • Visibility: public
Arguments
  • $bytes mixed

    the bytes to write to the socket.

Clone this wiki locally