PHP 클래스 TSocket, phpcassa

상속: extends TTransport, implements TTransportStatus, implements InstrumentedTTransport, use trait InstrumentedTTransportTrait
파일 보기 프로젝트 열기: hoan/phpcassa 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$debugHandler_ mixed Debug handler
$debug_ boolean Debugging on?
$host_ string Remote hostname
$port_ integer Remote port

공개 메소드들

메소드 설명
__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.

메소드 상세

__construct() 공개 메소드

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() 공개 메소드

Closes the socket.
public close ( )

flush() 공개 메소드

Flush output to the socket.
public flush ( )

getHost() 공개 메소드

Get the host that this socket is connected to
public getHost ( ) : string
리턴 string host

getPort() 공개 메소드

Get the remote port that this socket is connected to
public getPort ( ) : integer
리턴 integer port

isOpen() 공개 메소드

Tests whether this is open
public isOpen ( ) : boolean
리턴 boolean true if the socket is open

open() 공개 메소드

Connects the socket.
public open ( )

read() 공개 메소드

Read from the socket
public read ( integer $len ) : string
$len integer How many bytes
리턴 string Binary data

readAll() 공개 메소드

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

setDebug() 공개 메소드

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

setRecvTimeout() 공개 메소드

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

setSendTimeout() 공개 메소드

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

write() 공개 메소드

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

프로퍼티 상세

$debugHandler_ 보호되어 있는 프로퍼티

Debug handler
protected mixed $debugHandler_
리턴 mixed

$debug_ 보호되어 있는 프로퍼티

Debugging on?
protected bool $debug_
리턴 boolean

$host_ 보호되어 있는 프로퍼티

Remote hostname
protected string $host_
리턴 string

$port_ 보호되어 있는 프로퍼티

Remote port
protected int $port_
리턴 integer