PHP 클래스 Horde\Socket\Client

저자: Michael Slusarz ([email protected])
저자: Jan Schneider ([email protected])
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_connected boolean Is there an active connection?
$_params array Configuration parameters.
$_secure boolean Is the connection secure?
$_stream resource The actual socket.

공개 메소드들

메소드 설명
__clone ( ) This object can not be cloned.
__construct ( string $host, integer $port = null, integer $timeout = 30, mixed $secure = false, array $context = [], array $params = [] ) Constructor.
__get ( $name )
__sleep ( ) This object can not be serialized.
close ( ) Close the connection.
getStatus ( ) : array Returns information about the connection.
gets ( integer $size ) : string Returns a line of data.
read ( integer $size ) : string Returns a specified amount of data.
startTls ( ) : boolean Start a TLS connection.
write ( string $data ) Writes data to the stream.

보호된 메소드들

메소드 설명
_checkStream ( ) Throws an exception is the stream is not a resource.
_connect ( $host, $port, $timeout, $secure, $context, $retries ) Connect to the remote server.

메소드 상세

__clone() 공개 메소드

This object can not be cloned.
public __clone ( )

__construct() 공개 메소드

Constructor.
public __construct ( string $host, integer $port = null, integer $timeout = 30, mixed $secure = false, array $context = [], array $params = [] )
$host string Hostname of remote server (can contain protocol prefx).
$port integer Port number of remote server.
$timeout integer Connection timeout (in seconds).
$secure mixed Security layer requested. One of: - false: (No encryption) [DEFAULT] - 'ssl': (Auto-detect SSL version) - 'sslv2': (Force SSL version 3) - 'sslv3': (Force SSL version 2) - 'tls': (TLS; started via protocol-level negotation over unencrypted channel) - 'tlsv1': (TLS version 1.x connection) - true: (TLS if available/necessary)
$context array Any context parameters passed to stream_create_context().
$params array Additional options.

__get() 공개 메소드

public __get ( $name )

__sleep() 공개 메소드

This object can not be serialized.
public __sleep ( )

_checkStream() 보호된 메소드

Throws an exception is the stream is not a resource.
protected _checkStream ( )

_connect() 보호된 메소드

Connect to the remote server.
또한 보기: __construct()
protected _connect ( $host, $port, $timeout, $secure, $context, $retries )

close() 공개 메소드

Close the connection.
public close ( )

getStatus() 공개 메소드

Currently returns four entries in the result array: - timed_out (bool): The socket timed out waiting for data - blocked (bool): The socket was blocked - eof (bool): Indicates EOF event - unread_bytes (int): Number of bytes left in the socket buffer
public getStatus ( ) : array
리턴 array Information about existing socket resource.

gets() 공개 메소드

Returns a line of data.
public gets ( integer $size ) : string
$size integer Reading ends when $size - 1 bytes have been read, or a newline or an EOF (whichever comes first).
리턴 string $size bytes of data from the socket

read() 공개 메소드

Returns a specified amount of data.
public read ( integer $size ) : string
$size integer The number of bytes to read from the socket.
리턴 string $size bytes of data from the socket.

startTls() 공개 메소드

Start a TLS connection.
public startTls ( ) : boolean
리턴 boolean Whether TLS was successfully started.

write() 공개 메소드

Writes data to the stream.
public write ( string $data )
$data string Data to write.

프로퍼티 상세

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

Is there an active connection?
protected bool $_connected
리턴 boolean

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

Configuration parameters.
protected array $_params
리턴 array

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

Is the connection secure?
protected bool $_secure
리턴 boolean

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

The actual socket.
protected resource $_stream
리턴 resource