PHP Class TSocket, phpcassa

Inheritance: extends TTransport, implements TTransportStatus, implements InstrumentedTTransport, use trait InstrumentedTTransportTrait
Afficher le fichier Open project: hoan/phpcassa Class Usage Examples

Protected Properties

Свойство Type Description
$debugHandler_ mixed Debug handler
$debug_ boolean Debugging on?
$host_ string Remote hostname
$port_ integer Remote port

Méthodes publiques

Méthode Description
__construct ( string $host = 'localhost', integer $port = 9090, boolean $persist = FALSE, string $debugHandler = null ) Socket constructor
close ( ) Closes the socket.
flush ( ) Flush output to the socket.
getHost ( ) : string Get the host that this socket is connected to
getPort ( ) : integer Get the remote port that this socket is connected to
isOpen ( ) : boolean Tests whether this is open
open ( ) Connects the socket.
read ( integer $len ) : string Read from the socket
readAll ( integer $len ) : string Uses stream get contents to do the reading
setDebug ( boolean $debug ) Sets debugging output on or off
setRecvTimeout ( integer $timeout ) Sets the receive timeout.
setSendTimeout ( integer $timeout ) Sets the send timeout.
write ( string $buf ) Write to the socket.

Method Details

__construct() public méthode

Socket constructor
public __construct ( string $host = 'localhost', integer $port = 9090, boolean $persist = FALSE, string $debugHandler = null )
$host string Remote hostname
$port integer Remote port
$persist boolean Whether to use a persistent socket
$debugHandler string Function to call for error logging

close() public méthode

Closes the socket.
public close ( )

flush() public méthode

Flush output to the socket.
public flush ( )

getHost() public méthode

Get the host that this socket is connected to
public getHost ( ) : string
Résultat string host

getPort() public méthode

Get the remote port that this socket is connected to
public getPort ( ) : integer
Résultat integer port

isOpen() public méthode

Tests whether this is open
public isOpen ( ) : boolean
Résultat boolean true if the socket is open

open() public méthode

Connects the socket.
public open ( )

read() public méthode

Read from the socket
public read ( integer $len ) : string
$len integer How many bytes
Résultat string Binary data

readAll() public méthode

Uses stream get contents to do the reading
public readAll ( integer $len ) : string
$len integer How many bytes
Résultat string Binary data

setDebug() public méthode

Sets debugging output on or off
public setDebug ( boolean $debug )
$debug boolean

setRecvTimeout() public méthode

Sets the receive timeout.
public setRecvTimeout ( integer $timeout )
$timeout integer Timeout in milliseconds.

setSendTimeout() public méthode

Sets the send timeout.
public setSendTimeout ( integer $timeout )
$timeout integer Timeout in milliseconds.

write() public méthode

Write to the socket.
public write ( string $buf )
$buf string The data to write

Property Details

$debugHandler_ protected_oe property

Debug handler
protected mixed $debugHandler_
Résultat mixed

$debug_ protected_oe property

Debugging on?
protected bool $debug_
Résultat boolean

$host_ protected_oe property

Remote hostname
protected string $host_
Résultat string

$port_ protected_oe property

Remote port
protected int $port_
Résultat integer