PHP Class ElephantIO\Engine\AbstractSocketIO

Inheritance: implements ElephantIO\EngineInterface
Mostra file Open project: wisembly/elephant.io Class Usage Examples

Protected Properties

Property Type Description
$context Array of php stream context options
$cookies cookies received during handshake
$namespace the namespace of the next message
$options Array of options for the engine
$session Session information
$stream Resource to the connected stream
$url Parse url result

Public Methods

Method Description
__construct ( $url, array $options = [] )
close ( ) {@inheritDoc}
connect ( ) {@inheritDoc}
emit ( $event, array $args ) {@inheritDoc}
getName ( ) {@inheritDoc}
keepAlive ( ) {@inheritDoc}
of ( $namespace ) {@inheritDoc}
read ( ) {@inheritDoc}
write ( integer $code, string $message = null ) Write the message to the socket

Protected Methods

Method Description
getDefaultOptions ( ) : array Get the defaults options
parseUrl ( $url ) : string[] Parse an url into parts we may expect

Method Details

__construct() public method

public __construct ( $url, array $options = [] )
$options array

close() public method

{@inheritDoc}
public close ( )

connect() public method

{@inheritDoc}
public connect ( )

emit() public method

{@inheritDoc}
public emit ( $event, array $args )
$args array

getDefaultOptions() protected method

Get the defaults options
protected getDefaultOptions ( ) : array
return array mixed[] Defaults options for this engine

getName() public method

{@inheritDoc}
public getName ( )

keepAlive() public method

{@inheritDoc}
public keepAlive ( )

of() public method

{@inheritDoc}
public of ( $namespace )

parseUrl() protected method

Parse an url into parts we may expect
protected parseUrl ( $url ) : string[]
return string[] information on the given URL

read() public method

Be careful, this method may hang your script, as we're not in a non blocking mode.
public read ( )

write() abstract public method

Write the message to the socket
abstract public write ( integer $code, string $message = null )
$code integer type of message (one of EngineInterface constants)
$message string Message to send, correctly formatted

Property Details

$context protected_oe property

Array of php stream context options
protected $context

$cookies protected_oe property

cookies received during handshake
protected $cookies

$namespace protected_oe property

the namespace of the next message
protected $namespace

$options protected_oe property

Array of options for the engine
protected $options

$session protected_oe property

Session information
protected $session

$stream protected_oe property

Resource to the connected stream
protected $stream

$url protected_oe property

Parse url result
protected $url