PHP 클래스 Sulu\Bundle\WebsocketBundle\App\WebsocketApp

파일 보기 프로젝트 열기: sulu/sulu 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$routes Symfony\Component\Routing\RouteCollection

보호된 프로퍼티들

프로퍼티 타입 설명
$_routeCounter integer
$_server Ratchet\Server\IoServer
$httpHost string The Host passed in construct used for same origin policy.
$port * The port the socket is listening

공개 메소드들

메소드 설명
__construct ( string $httpHost = 'localhost', integer $port = 8080, string $address = '127.0.0.1', React\EventLoop\LoopInterface $loop = null )
route ( string $path, Ratchet\ComponentInterface $controller, array $allowedOrigins = [], string $httpHost = null ) : Ratchet\ComponentInterface | Ratchet\WebSocket\WsServer Add an endpoint/application to the server.
run ( ) Run the server by entering the event loop.

메소드 상세

__construct() 공개 메소드

public __construct ( string $httpHost = 'localhost', integer $port = 8080, string $address = '127.0.0.1', React\EventLoop\LoopInterface $loop = null )
$httpHost string HTTP hostname clients intend to connect to. MUST match JS `new WebSocket('ws://$httpHost');`
$port integer Port to listen on. If 80, assuming production, Flash on 843 otherwise expecting Flash to be proxied through 8843
$address string IP address to bind to. Default is localhost/proxy only. '0.0.0.0' for any machine
$loop React\EventLoop\LoopInterface Specific React\EventLoop to bind the application to. null will create one for you

route() 공개 메소드

Add an endpoint/application to the server.
public route ( string $path, Ratchet\ComponentInterface $controller, array $allowedOrigins = [], string $httpHost = null ) : Ratchet\ComponentInterface | Ratchet\WebSocket\WsServer
$path string The URI the client will connect to
$controller Ratchet\ComponentInterface 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
리턴 Ratchet\ComponentInterface | Ratchet\WebSocket\WsServer

run() 공개 메소드

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

프로퍼티 상세

$_routeCounter 보호되어 있는 프로퍼티

protected int $_routeCounter
리턴 integer

$_server 보호되어 있는 프로퍼티

protected IoServer,Ratchet\Server $_server
리턴 Ratchet\Server\IoServer

$httpHost 보호되어 있는 프로퍼티

The Host passed in construct used for same origin policy.
protected string $httpHost
리턴 string

$port 보호되어 있는 프로퍼티

* The port the socket is listening
protected $port

$routes 공개적으로 프로퍼티

public RouteCollection,Symfony\Component\Routing $routes
리턴 Symfony\Component\Routing\RouteCollection