PHP Класс Sulu\Component\Websocket\MessageDispatcher\MessageDispatcherApp

Наследование: extends Sulu\Component\Websocket\AbstractWebsocketApp, implements Ratchet\MessageComponentInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$messageDispatcher Sulu\Component\Websocket\MessageDispatcher\MessageDispatcherInterface
$name

Открытые методы

Метод Описание
__construct ( $appName, Sulu\Component\Websocket\MessageDispatcher\MessageDispatcherInterface $messageDispatcher, Doctrine\Common\Cache\Cache $contextsCache )
onClose ( Ratchet\ConnectionInterface $connection )
onMessage ( Ratchet\ConnectionInterface $from, string $msg ) Triggered when a client sends data through the socket.

Защищенные методы

Метод Описание
createMessageHandlerContext ( Sulu\Component\Websocket\ConnectionContext\ConnectionContextInterface $context, string $handlerName ) : MessageHandlerContext Create a message handler context.

Приватные методы

Метод Описание
dispatch ( Ratchet\ConnectionInterface $conn, Sulu\Component\Websocket\ConnectionContext\ConnectionContextInterface $context, array $msg ) Dispatches message to handler with dispatcher service.

Описание методов

__construct() публичный Метод

public __construct ( $appName, Sulu\Component\Websocket\MessageDispatcher\MessageDispatcherInterface $messageDispatcher, Doctrine\Common\Cache\Cache $contextsCache )
$messageDispatcher Sulu\Component\Websocket\MessageDispatcher\MessageDispatcherInterface
$contextsCache Doctrine\Common\Cache\Cache

createMessageHandlerContext() защищенный Метод

Create a message handler context.
protected createMessageHandlerContext ( Sulu\Component\Websocket\ConnectionContext\ConnectionContextInterface $context, string $handlerName ) : MessageHandlerContext
$context Sulu\Component\Websocket\ConnectionContext\ConnectionContextInterface
$handlerName string
Результат MessageHandlerContext

onClose() публичный Метод

public onClose ( Ratchet\ConnectionInterface $connection )
$connection Ratchet\ConnectionInterface

onMessage() публичный Метод

Triggered when a client sends data through the socket.
public onMessage ( Ratchet\ConnectionInterface $from, string $msg )
$from Ratchet\ConnectionInterface The socket/connection that sent the message to your application
$msg string The message received

Описание свойств

$messageDispatcher защищенное свойство

protected MessageDispatcherInterface,Sulu\Component\Websocket\MessageDispatcher $messageDispatcher
Результат Sulu\Component\Websocket\MessageDispatcher\MessageDispatcherInterface

$name защищенное свойство

protected $name