PHP Class Kraken\Network\Websocket\WsServer

Inheritance: implements Kraken\Network\Websocket\WsServerInterface, implements Kraken\Network\NetworkComponentAwareInterface
显示文件 Open project: kraken-php/framework

Protected Properties

Property Type Description
$connCollection SplObjectStorage
$wsDriver Kraken\Network\Websocket\Driver\WsDriverInterface
$wsServer Kraken\Network\NetworkComponentInterface

Public Methods

Method Description
__construct ( Kraken\Network\NetworkComponentAwareInterface $aware = null, Kraken\Network\NetworkComponentInterface $component = null )
__destruct ( )
getComponent ( )
getDriver ( )
handleConnect ( Kraken\Network\NetworkConnectionInterface $conn )
handleDisconnect ( Kraken\Network\NetworkConnectionInterface $conn )
handleError ( Kraken\Network\NetworkConnectionInterface $conn, $ex )
handleMessage ( Kraken\Network\NetworkConnectionInterface $conn, Kraken\Network\NetworkMessageInterface $message )
setComponent ( Kraken\Network\NetworkComponentInterface $component = null )

Protected Methods

Method Description
attemptUpgrade ( Kraken\Network\NetworkConnectionInterface $conn )
close ( Kraken\Network\NetworkConnectionInterface $conn, integer $code = 400 ) : null Close a connection with an HTTP response.

Method Details

__construct() public method

public __construct ( Kraken\Network\NetworkComponentAwareInterface $aware = null, Kraken\Network\NetworkComponentInterface $component = null )
$aware Kraken\Network\NetworkComponentAwareInterface
$component Kraken\Network\NetworkComponentInterface

__destruct() public method

public __destruct ( )

attemptUpgrade() protected method

protected attemptUpgrade ( Kraken\Network\NetworkConnectionInterface $conn )
$conn Kraken\Network\NetworkConnectionInterface

close() protected method

Close a connection with an HTTP response.
protected close ( Kraken\Network\NetworkConnectionInterface $conn, integer $code = 400 ) : null
$conn Kraken\Network\NetworkConnectionInterface
$code integer
return null

getComponent() public method

public getComponent ( )

getDriver() public method

public getDriver ( )

handleConnect() public method

public handleConnect ( Kraken\Network\NetworkConnectionInterface $conn )
$conn Kraken\Network\NetworkConnectionInterface

handleDisconnect() public method

public handleDisconnect ( Kraken\Network\NetworkConnectionInterface $conn )
$conn Kraken\Network\NetworkConnectionInterface

handleError() public method

public handleError ( Kraken\Network\NetworkConnectionInterface $conn, $ex )
$conn Kraken\Network\NetworkConnectionInterface

handleMessage() public method

public handleMessage ( Kraken\Network\NetworkConnectionInterface $conn, Kraken\Network\NetworkMessageInterface $message )
$conn Kraken\Network\NetworkConnectionInterface
$message Kraken\Network\NetworkMessageInterface

setComponent() public method

public setComponent ( Kraken\Network\NetworkComponentInterface $component = null )
$component Kraken\Network\NetworkComponentInterface

Property Details

$connCollection protected_oe property

protected SplObjectStorage $connCollection
return SplObjectStorage

$wsDriver protected_oe property

protected WsDriverInterface,Kraken\Network\Websocket\Driver $wsDriver
return Kraken\Network\Websocket\Driver\WsDriverInterface

$wsServer protected_oe property

protected NetworkComponentInterface,Kraken\Network $wsServer
return Kraken\Network\NetworkComponentInterface