PHP Class Askedio\LaravelRatchet\PusherServer

Inheritance: implements Ratchet\Wamp\WampServerInterface
Datei anzeigen Open project: askedio/laravel-ratchet

Public Methods

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.

Method Details

onCall() public method

An RPC call has been received.
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

onClose() public method

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.
public onClose ( Ratchet\ConnectionInterface $conn )
$conn Ratchet\ConnectionInterface The socket/connection that is closing/closed

onError() public method

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.
public onError ( Ratchet\ConnectionInterface $conn, Exception $exception )
$conn Ratchet\ConnectionInterface
$exception Exception

onOpen() public method

When a new connection is opened it will be passed to this method.
public onOpen ( Ratchet\ConnectionInterface $conn )
$conn Ratchet\ConnectionInterface The socket/connection that just connected to your application

onPublish() public method

A client is attempting to publish content to a subscribed connections on a URI.
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)

onSubscribe() public method

A request to subscribe to a topic has been made.
public onSubscribe ( Ratchet\ConnectionInterface $conn, string | Topic $topic )
$conn Ratchet\ConnectionInterface
$topic string | Topic The topic to subscribe to

onUnSubscribe() public method

A request to unsubscribe from a topic has been made.
public onUnSubscribe ( Ratchet\ConnectionInterface $conn, string | Topic $topic )
$conn Ratchet\ConnectionInterface
$topic string | Topic The topic to unsubscribe from