Photon Server API
Public Member Functions | Properties | Events | List of all members
ExitGames.Messaging.Channels.TopicMessageReceiver Class Reference

The TopicMessageReceiver receives TopicMessages from an ISocketReceiver. More...

Inheritance diagram for ExitGames.Messaging.Channels.TopicMessageReceiver:

Public Member Functions

 TopicMessageReceiver (ISocketReceiver socketReceiver, Guid hostId)
 Initializes a new instance of the TopicMessageReceiver class. More...
 
TopicSubscription< T > Subscribe< T > (string topic, Concurrency.Channels.IPublisher< T > targetPublisher, IMessageSerializer< T > serializer)
 Creates a new TopicSubscription<T>. More...
 
void Dispose ()
 Removes event handler from the socket receiver. More...
 

Properties

Guid HostId [get]
 Gets the local host id. Received messages with the same host id are ignored. More...
 
ICounter CounterMsgHeaderDeserializeMs [get, set]
 

Events

Action< TopicMessageMessageReceived
 This event is invoked when a new TopicMessage is received. More...
 

Detailed Description

The TopicMessageReceiver receives TopicMessages from an ISocketReceiver.

Constructor & Destructor Documentation

ExitGames.Messaging.Channels.TopicMessageReceiver.TopicMessageReceiver ( ISocketReceiver  socketReceiver,
Guid  hostId 
)
inline

Initializes a new instance of the TopicMessageReceiver class.

Parameters
socketReceiverThe socket receiver.
hostIdThe host id is used to filter message received from the local host.

Member Function Documentation

void ExitGames.Messaging.Channels.TopicMessageReceiver.Dispose ( )
inline

Removes event handler from the socket receiver.

TopicSubscription<T> ExitGames.Messaging.Channels.TopicMessageReceiver.Subscribe< T > ( string  topic,
Concurrency.Channels.IPublisher< T >  targetPublisher,
IMessageSerializer< T >  serializer 
)
inline

Creates a new TopicSubscription<T>.

Template Parameters
TThe message type.
Parameters
topicThe topic.
targetPublisherThe target channel.
serializerThe message deserializer.
Returns
A new TopicSubscription<T>.

Property Documentation

ICounter ExitGames.Messaging.Channels.TopicMessageReceiver.CounterMsgHeaderDeserializeMs
getset
Guid ExitGames.Messaging.Channels.TopicMessageReceiver.HostId
get

Gets the local host id. Received messages with the same host id are ignored.

Event Documentation

Action<TopicMessage> ExitGames.Messaging.Channels.TopicMessageReceiver.MessageReceived

This event is invoked when a new TopicMessage is received.