Overview

Namespaces

  • Evenement
  • None
  • PHP
  • Psr
    • Http
      • Message
  • Ratchet
    • Http
    • RFC6455
      • Handshake
      • Messaging
    • Server
    • Session
      • Serialize
      • Storage
        • Proxy
    • Wamp
    • WebSocket
  • React
    • EventLoop
      • Tick
      • Timer
    • Socket
    • Stream
  • Symfony
    • Component
      • HttpFoundation
        • Session
          • Attribute
          • Flash
          • Storage
            • Handler
            • Proxy
      • Routing
        • Annotation
        • Exception
        • Generator
          • Dumper
        • Loader
          • DependencyInjection
        • Matcher
          • Dumper
        • Tests
          • Annotation
          • Fixtures
            • AnnotatedClasses
            • OtherAnnotatedClasses
          • Generator
            • Dumper
          • Loader
          • Matcher
            • Dumper

Classes

  • ServerProtocol
  • Topic
  • TopicManager
  • WampConnection
  • WampServer

Interfaces

  • WampServerInterface

Exceptions

  • Exception
  • JsonException
  • Overview
  • Namespace
  • Class
  • Tree

Class TopicManager

WebSocket Server Interface

Ratchet\Wamp\TopicManager implements Ratchet\WebSocket\WsServerInterface, Ratchet\Wamp\WampServerInterface
Namespace: Ratchet\Wamp
Located at Ratchet/Wamp/TopicManager.php
Methods summary
public
# __construct( Ratchet\Wamp\WampServerInterface $app )
public
# onOpen( Ratchet\ConnectionInterface $conn )

When a new connection is opened it will be passed to this method

When a new connection is opened it will be passed to this method

Parameters

$conn
Ratchet\ConnectionInterface
$conn The socket/connection that just connected to your application

Throws

Exception

Implementation of

Ratchet\ComponentInterface::onOpen()
public
# onCall( Ratchet\ConnectionInterface $conn, string $id, string|Ratchet\Wamp\Topic $topic, array $params )

An RPC call has been received

An RPC call has been received

Parameters

$conn
Ratchet\ConnectionInterface
$conn
$id
string
$id The unique ID of the RPC, required to respond to
$topic
string|Ratchet\Wamp\Topic
$topic The topic to execute the call against
$params
array
$params Call parameters received from the client

Implementation of

Ratchet\Wamp\WampServerInterface::onCall()
public
# onSubscribe( Ratchet\ConnectionInterface $conn, string|Ratchet\Wamp\Topic $topic )

A request to subscribe to a topic has been made

A request to subscribe to a topic has been made

Parameters

$conn
Ratchet\ConnectionInterface
$conn
$topic
string|Ratchet\Wamp\Topic
$topic The topic to subscribe to

Implementation of

Ratchet\Wamp\WampServerInterface::onSubscribe()
public
# onUnsubscribe( Ratchet\ConnectionInterface $conn, mixed $topic )
public
# onPublish( Ratchet\ConnectionInterface $conn, string|Ratchet\Wamp\Topic $topic, string $event, array $exclude, array $eligible )

A client is attempting to publish content to a subscribed connections on a URI

A client is attempting to publish content to a subscribed connections on a URI

Parameters

$conn
Ratchet\ConnectionInterface
$conn
$topic
string|Ratchet\Wamp\Topic
$topic The topic the user has attempted to publish to
$event
string
$event Payload of the publish
$exclude
array
$exclude A list of session IDs the message should be excluded from (blacklist)
$eligible
array
$eligible A list of session Ids the message should be send to (whitelist)

Implementation of

Ratchet\Wamp\WampServerInterface::onPublish()
public
# 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.

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.

Parameters

$conn
Ratchet\ConnectionInterface
$conn The socket/connection that is closing/closed

Throws

Exception

Implementation of

Ratchet\ComponentInterface::onClose()
public
# onError( Ratchet\ConnectionInterface $conn, Ratchet\Wamp\Exception $e )

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

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

Parameters

$conn
Ratchet\ConnectionInterface
$conn
$e
Exception
$e

Throws

Exception

Implementation of

Ratchet\ComponentInterface::onError()
public array
# getSubProtocols( )

If any component in a stack supports a WebSocket sub-protocol return each supported in an array

If any component in a stack supports a WebSocket sub-protocol return each supported in an array

Returns

array

Implementation of

Ratchet\WebSocket\WsServerInterface::getSubProtocols()
protected Ratchet\Wamp\Topic
# getTopic( string $topic )

Parameters

$topic
string

Returns

Ratchet\Wamp\Topic
protected
# cleanTopic( Ratchet\Wamp\Topic $topic, Ratchet\ConnectionInterface $conn )
Methods inherited from Ratchet\Wamp\WampServerInterface
onUnSubscribe()
Properties summary
protected Ratchet\Wamp\WampServerInterface $app
#
protected array $topicLookup array()
#
Ratchet API documentation generated by ApiGen 2.8.0