PHP 클래스 lithium\net\Socket

상속: extends lithium\core\Object
파일 보기 프로젝트 열기: unionofrad/lithium 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_autoConfig array Auto config.
$_classes array The classes for the socket.
$_resource resource The resource for the current connection.

공개 메소드들

메소드 설명
__construct ( array $config = [] ) : void Constructor.
__destruct ( ) : void Destructor.
close ( ) : boolean Closes the socket and unsets Socket::$_resource.
encoding ( string $charset ) : boolean Sets the encoding of the socket connection.
eof ( ) : boolean Test for the end-of-file on the socket.
open ( array $options = [] ) : mixed Opens the socket and sets Socket::$_resource.
read ( ) : object Reads from the socket.
resource ( ) : resource Returns the resource.
send ( Message $message = null, array $options = [] ) : object Aggregates read and write methods into a coherent request response
set ( array $flags, array $value = null ) : void Sets the options to be used in subsequent requests.
timeout ( integer $time ) : boolean Sets the timeout on the socket *connection*.
write ( mixed $data ) : boolean Writes data to the socket.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( array $config = [] ) : void
$config array Available configuration options are: - `'persistent'`: Use a persistent connection (defaults to `false`). - `'protocol'`: Transfer protocol to use (defaults to `'tcp'`). - `'host'`: Host name or address (defaults to `'localhost'`). - `'login'`: Username for a login (defaults to `'root'`). - `'password'`: Password for a login (defaults to `''`). - `'port'`: Host port (defaults to `80`). - `'timeout'`: Seconds after opening the socket times out (defaults to `30`).
리턴 void

__destruct() 공개 메소드

Destructor.
public __destruct ( ) : void
리턴 void

close() 추상적인 공개 메소드

Closes the socket and unsets Socket::$_resource.
abstract public close ( ) : boolean
리턴 boolean `true` on success, `false` otherwise.

encoding() 추상적인 공개 메소드

Sets the encoding of the socket connection.
abstract public encoding ( string $charset ) : boolean
$charset string The character set to use.
리턴 boolean `true` if encoding has been set, `false` otherwise.

eof() 추상적인 공개 메소드

Test for the end-of-file on the socket.
abstract public eof ( ) : boolean
리턴 boolean `true` if end has been reached, `false` otherwise.

open() 공개 메소드

Opens the socket and sets Socket::$_resource.
public open ( array $options = [] ) : mixed
$options array Update the config settings.
리턴 mixed The open resource on success, `false` otherwise.

read() 추상적인 공개 메소드

Reads from the socket.
abstract public read ( ) : object
리턴 object `lithium\net\Message`

resource() 공개 메소드

Returns the resource.
public resource ( ) : resource
리턴 resource

send() 공개 메소드

Aggregates read and write methods into a coherent request response
public send ( Message $message = null, array $options = [] ) : object
$message Message
$options array - '`response`': a fully-namespaced string for the response object
리턴 object a response object based on `\lithium\net\Message`

set() 공개 메소드

Sets the options to be used in subsequent requests.
public set ( array $flags, array $value = null ) : void
$flags array If $values is an array, $flags will be used as the keys to an associative array of curl options. If $values is not set, then $flags will be used as the associative array.
$value array If set, this array becomes the values for the associative array of curl options.
리턴 void

timeout() 추상적인 공개 메소드

Sets the timeout on the socket *connection*.
abstract public timeout ( integer $time ) : boolean
$time integer Seconds after the connection times out.
리턴 boolean `true` if timeout has been set, `false` otherwise.

write() 추상적인 공개 메소드

Writes data to the socket.
abstract public write ( mixed $data ) : boolean
$data mixed
리턴 boolean `true` if data has been successfully written, `false` otherwise.

프로퍼티 상세

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

Auto config.
protected array $_autoConfig
리턴 array

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

The classes for the socket.
protected array $_classes
리턴 array

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

The resource for the current connection.
protected resource $_resource
리턴 resource