PHP Interface Sulu\Component\Websocket\AppManagerInterface

ファイルを表示 Open project: sulu/sulu Interface Usage Examples

Public Methods

Method Description
add ( string $route, Sulu\Component\Websocket\WebsocketAppInterface $app, array $allowedOrigins = ['*'], string $httpHost = null )
getApp ( string $name ) : Sulu\Component\Websocket\WebsocketAppInterface Return websocket app.
getApps ( ) : array Returns apps and configuration.
getHttpHost ( ) : string Returns HTTP hostname clients intend to connect to.
getIpAddress ( ) : string Return IP address to bind to.
getLoop ( ) : React\EventLoop\LoopInterface Return used event loop if null default loop will be created.
getPort ( ) : integer Returns port to listen on.
run ( ) Run the server by entering the event loop.

Method Details

add() public method

public add ( string $route, Sulu\Component\Websocket\WebsocketAppInterface $app, array $allowedOrigins = ['*'], string $httpHost = null )
$route string The URI the client will connect to
$app Sulu\Component\Websocket\WebsocketAppInterface Your application to server for the route. If not specified, assumed to be for a WebSocket
$allowedOrigins array An array of hosts allowed to connect (same host by default), ['*'] for any
$httpHost string Override the $httpHost variable provided in the __construct

getApp() public method

Return websocket app.
public getApp ( string $name ) : Sulu\Component\Websocket\WebsocketAppInterface
$name string
return Sulu\Component\Websocket\WebsocketAppInterface

getApps() public method

Returns apps and configuration.
public getApps ( ) : array
return array

getHttpHost() public method

Returns HTTP hostname clients intend to connect to.
public getHttpHost ( ) : string
return string

getIpAddress() public method

Return IP address to bind to.
public getIpAddress ( ) : string
return string

getLoop() public method

Return used event loop if null default loop will be created.
public getLoop ( ) : React\EventLoop\LoopInterface
return React\EventLoop\LoopInterface

getPort() public method

Returns port to listen on.
public getPort ( ) : integer
return integer

run() public method

Run the server by entering the event loop.
public run ( )