PHP Class lithium\net\socket\Context

Inheritance: extends lithium\net\Socket
Show file Open project: unionofrad/lithium Class Usage Examples

Protected Properties

Property Type Description
$_content string Content of the stream
$_timeout integer Connection timeout value.

Public Methods

Method Description
__construct ( array $config = [] ) : void Constructor.
close ( ) : boolean Closes the socket connection.
encoding ( string $charset = null ) : boolean Sets the encoding of the socket connection. Does not apply to this implementation.
eof ( ) : boolean End of file test for this socket connection. Does not apply to this implementation.
open ( array $options = [] ) : mixed Opens the socket and sets its timeout value.
read ( ) : boolean | string Reads from the socket. Does not apply to this implementation.
timeout ( integer $time = null ) : booelan Sets the timeout on the socket *connection*.
write ( string $data = null ) : boolean Writes to the socket.

Method Details

__construct() public method

Constructor.
public __construct ( array $config = [] ) : void
$config array Available configuration options are: - `'mode'` _string_ - `'message'` _object_
return void

close() public method

Closes the socket connection.
public close ( ) : boolean
return boolean Success.

encoding() public method

Sets the encoding of the socket connection. Does not apply to this implementation.
public encoding ( string $charset = null ) : boolean
$charset string The character set to use.
return boolean `true` if encoding has been set, `false` otherwise.

eof() public method

End of file test for this socket connection. Does not apply to this implementation.
public eof ( ) : boolean
return boolean Success.

open() public method

Opens the socket and sets its timeout value.
public open ( array $options = [] ) : mixed
$options array Update the config settings.
return mixed Returns `false` if the socket configuration does not contain the `'scheme'` or `'host'` settings, or if configuration fails, otherwise returns a resource stream.

read() public method

Reads from the socket. Does not apply to this implementation.
public read ( ) : boolean | string
return boolean | string

timeout() public method

Sets the timeout on the socket *connection*.
public timeout ( integer $time = null ) : booelan
$time integer Seconds after the connection times out.
return booelan `true` if timeout has been set, `false` otherwise.

write() public method

Writes to the socket.
public write ( string $data = null ) : boolean
$data string Data to write.
return boolean Success

Property Details

$_content protected property

Content of the stream
protected string $_content
return string

$_timeout protected property

Connection timeout value.
protected int $_timeout
return integer