PHP Class Devristo\Phpws\Server\WebSocketServer

Author: Chris
Inheritance: extends Evenement\EventEmitter
Show file Open project: devristo/phpws Class Usage Examples

Protected Properties

Property Type Description
$FLASH_POLICY_FILE string Flash-policy-response for flashplayer/flashplugin
$_connections SplObjectStorage | Devristo\Phpws\Protocol\WebSocketTransportInterface[] The connected clients to the WebSocket server, a valid handshake has been performed.
$_context
$_streams Devristo\Phpws\Protocol\WebSocketConnection[] | SplObjectStorag\SplObjectStorage The raw streams connected to the WebSocket server (whether a handshake has taken place or not)
$_url
$purgeUserTimeOut
$uriHandlers Devristo\Phpws\Server\UriHandler\WebSocketUriHandlerInterface[] ..

Public Methods

Method Description
__construct ( $url, React\EventLoop\LoopInterface $loop, Zend\Log\LoggerInterface $logger ) Handle incoming messages.
bind ( ) Start the server
getConnections ( )
getStreamContext ( )
setStreamContext ( $context )

Method Details

__construct() public method

Must be implemented by all extending classes
public __construct ( $url, React\EventLoop\LoopInterface $loop, Zend\Log\LoggerInterface $logger )
$url
$loop React\EventLoop\LoopInterface
$logger Zend\Log\LoggerInterface

bind() public method

Start the server
public bind ( )

getConnections() public method

public getConnections ( )

getStreamContext() public method

public getStreamContext ( )

setStreamContext() public method

public setStreamContext ( $context )

Property Details

$FLASH_POLICY_FILE protected property

Flash-policy-response for flashplayer/flashplugin
protected string $FLASH_POLICY_FILE
return string

$_connections protected property

The connected clients to the WebSocket server, a valid handshake has been performed.
protected SplObjectStorage|WebSocketTransportInterface[],Devristo\Phpws\Protocol $_connections
return SplObjectStorage | Devristo\Phpws\Protocol\WebSocketTransportInterface[]

$_context protected property

protected $_context

$_streams protected property

The raw streams connected to the WebSocket server (whether a handshake has taken place or not)
protected WebSocketConnection[],Devristo\Phpws\Protocol|SplObjectStorage,SplObjectStorag $_streams
return Devristo\Phpws\Protocol\WebSocketConnection[] | SplObjectStorag\SplObjectStorage

$_url protected property

protected $_url

$purgeUserTimeOut protected property

protected $purgeUserTimeOut

$uriHandlers protected property

..
protected WebSocketUriHandlerInterface[],Devristo\Phpws\Server\UriHandler $uriHandlers
return Devristo\Phpws\Server\UriHandler\WebSocketUriHandlerInterface[]