PHP 클래스 lithium\net\socket\Stream

This stream adapter provides the required method implementations of the abstract Socket class for the open(), close(), read(), write(), timeout() eof() and encoding() methods.
또한 보기: lithium\net\socket\Stream
상속: extends lithium\net\Socket
파일 보기 프로젝트 열기: unionofrad/lithium 1 사용 예제들

공개 메소드들

메소드 설명
close ( ) : boolean Closes the stream
encoding ( string $charset ) : boolean Sets the character set for stream encoding if possible. The stream_encoding function is not guaranteed to be available as it is seems as if it's experimental or just not officially documented. If the function is not available returns false.
eof ( ) : boolean Determines if the socket resource is at EOF.
open ( array $options = [] ) : mixed Opens a socket and initializes the internal resource handle.
read ( integer $length = null, integer $offset = null ) : string Reads data from the stream resource
timeout ( integer $time ) : boolean Set timeout period on a stream.
write ( string $data = null ) : mixed writes data to the stream resource

메소드 상세

close() 공개 메소드

Closes the stream
public close ( ) : boolean
리턴 boolean True on closed connection

encoding() 공개 메소드

Sets the character set for stream encoding if possible. The stream_encoding function is not guaranteed to be available as it is seems as if it's experimental or just not officially documented. If the function is not available returns false.
public encoding ( string $charset ) : boolean
$charset string
리턴 boolean Returns `false` if `stream_encoding()` function does not exist, boolean result of `stream_encoding()` otherwise.

eof() 공개 메소드

Determines if the socket resource is at EOF.
public eof ( ) : boolean
리턴 boolean Returns `true` if resource pointer is at its EOF, `false` otherwise.

open() 공개 메소드

Opens a socket and initializes the internal resource handle.
public open ( array $options = [] ) : mixed
$options array update the config settings
리턴 mixed Returns `false` if the socket configuration does not contain the `'scheme'` or `'host'` settings, or if configuration fails, otherwise returns a resource stream. Throws exception if there is a network error.

read() 공개 메소드

Reads data from the stream resource
public read ( integer $length = null, integer $offset = null ) : string
$length integer If specified, will read up to $length bytes from the stream. If no value is specified, all remaining bytes in the buffer will be read.
$offset integer Seek to the specified byte offset before reading.
리턴 string Returns string read from stream resource on success, false otherwise.

timeout() 공개 메소드

Set timeout period on a stream.
public timeout ( integer $time ) : boolean
$time integer The timeout value in seconds.
리턴 boolean

write() 공개 메소드

writes data to the stream resource
public write ( string $data = null ) : mixed
$data string The string to be written.
리턴 mixed False on error, number of bytes written otherwise.