\Thrift\TransportTNonblockingSocket

Base interface for a transport agent.

Summary

Methods
Properties
Constants
isOpen()
open()
close()
read()
readAll()
write()
flush()
__construct()
setSendTimeout()
setRecvTimeout()
setDebug()
No public properties found
No constants found
No protected methods found
$debug_
$debugHandler_
N/A
No private methods found
$handle_
$sendTimeout_
$recvTimeout_
$sendTimeoutSet_
$persist_
N/A

Properties

$debug_

$debug_ : boolean

Debugging on?

Type

boolean

$debugHandler_

$debugHandler_ : mixed

Debug handler

Type

mixed

$handle_

$handle_ : resource

Handle to PHP socket

Type

resource

$sendTimeout_

$sendTimeout_ : integer

Send timeout in milliseconds

Type

integer

$recvTimeout_

$recvTimeout_ : integer

Recv timeout in milliseconds

Type

integer

$sendTimeoutSet_

$sendTimeoutSet_ : boolean

Is send timeout set?

Type

boolean

$persist_

$persist_ : boolean

Persistent socket or plain?

Type

boolean

Methods

isOpen()

isOpen() : boolean

Tests whether this is open

Returns

boolean —

true if the socket is open

open()

open() 

Connects the socket.

close()

close() 

Closes the socket.

read()

read(integer  $len) : string

Read from the socket

Parameters

integer $len

How many bytes

Returns

string —

Binary data

readAll()

readAll(integer  $len) : string

Uses stream get contents to do the reading

Parameters

integer $len

How many bytes

Returns

string —

Binary data

write()

write(string  $buf) 

Write to the socket.

Parameters

string $buf

The data to write

flush()

flush() 

Flush output to the socket.

__construct()

__construct(string  $socket, string  $debugHandler = 'error_log') 

Socket constructor

Parameters

string $socket

resource of php socket

string $debugHandler

Function to call for error logging

setSendTimeout()

setSendTimeout(integer  $timeout) 

Sets the send timeout.

Parameters

integer $timeout

Timeout in milliseconds.

setRecvTimeout()

setRecvTimeout(integer  $timeout) 

Sets the receive timeout.

Parameters

integer $timeout

Timeout in milliseconds.

setDebug()

setDebug(boolean  $debug) 

Sets debugging output on or off

Parameters

boolean $debug