Method | Description | |
---|---|---|
onCall ( Ratchet\ConnectionInterface $conn, string $id, string | Topic $topic, array $params ) | An RPC call has been received. | |
onClose ( Ratchet\ConnectionInterface $conn ) | This is called before or after a socket is closed (depends on how it's closed). SendMessage to $conn will not result in an error if it has already been closed. | |
onError ( Ratchet\ConnectionInterface $conn, Exception $exception ) | If there is an error with one of the sockets, or somewhere in the application where an Exception is thrown, the Exception is sent back down the stack, handled by the Server and bubbled back up the application through this method. | |
onOpen ( Ratchet\ConnectionInterface $conn ) | When a new connection is opened it will be passed to this method. | |
onPublish ( Ratchet\ConnectionInterface $conn, string | Topic $topic, string $event, array $exclude, array $eligible ) | A client is attempting to publish content to a subscribed connections on a URI. | |
onSubscribe ( Ratchet\ConnectionInterface $conn, string | Topic $topic ) | A request to subscribe to a topic has been made. | |
onUnSubscribe ( Ratchet\ConnectionInterface $conn, string | Topic $topic ) | A request to unsubscribe from a topic has been made. |
public onCall ( Ratchet\ConnectionInterface $conn, string $id, string | Topic $topic, array $params ) | ||
$conn | Ratchet\ConnectionInterface | |
$id | string | The unique ID of the RPC, required to respond to |
$topic | string | Topic | The topic to execute the call against |
$params | array | Call parameters received from the client |
public onClose ( Ratchet\ConnectionInterface $conn ) | ||
$conn | Ratchet\ConnectionInterface | The socket/connection that is closing/closed |
public onError ( Ratchet\ConnectionInterface $conn, Exception $exception ) | ||
$conn | Ratchet\ConnectionInterface | |
$exception | Exception |
public onOpen ( Ratchet\ConnectionInterface $conn ) | ||
$conn | Ratchet\ConnectionInterface | The socket/connection that just connected to your application |
public onPublish ( Ratchet\ConnectionInterface $conn, string | Topic $topic, string $event, array $exclude, array $eligible ) | ||
$conn | Ratchet\ConnectionInterface | |
$topic | string | Topic | The topic the user has attempted to publish to |
$event | string | Payload of the publish |
$exclude | array | A list of session IDs the message should be excluded from (blacklist) |
$eligible | array | A list of session Ids the message should be send to (whitelist) |
public onSubscribe ( Ratchet\ConnectionInterface $conn, string | Topic $topic ) | ||
$conn | Ratchet\ConnectionInterface | |
$topic | string | Topic | The topic to subscribe to |
public onUnSubscribe ( Ratchet\ConnectionInterface $conn, string | Topic $topic ) | ||
$conn | Ratchet\ConnectionInterface | |
$topic | string | Topic | The topic to unsubscribe from |