Photon Server API
Public Member Functions | Protected Member Functions | Properties | List of all members
ExitGames.Messaging.MessageQueueReaderSingleThreaded Class Referenceabstract

Reads messages from MessageQueues and dispatches them More...

Inheritance diagram for ExitGames.Messaging.MessageQueueReaderSingleThreaded:

Public Member Functions

void BeginStop ()
 The begin stop. More...
 
bool EndStop (int waitSeconds)
 waits until reading stops or timeout expired More...
 
void Start ()
 Creates a listening thread and starts it. While running, the thread will listen to the specified message queue and dispatch incoming messages by calling the abstract method DispatchMessage. If UsePeeking is set to true, no messages will be lost if an error occurs during the procession of the message. More...
 
void Stop ()
 Stops the reader thread, throws TimeoutException if not stopped within 1 minute. More...
 
bool Stop (int waitSeconds)
 Stops the reader thread. More...
 
void Dispose ()
 The dispose. More...
 

Protected Member Functions

 MessageQueueReaderSingleThreaded (string msmq)
 Initializes a new instance of the MessageQueueReaderSingleThreaded class. More...
 
abstract void DispatchMessage (Message message)
 Implementors should provide functionality to process the received message. More...
 
virtual void Dispose (bool disposing)
 The dispose. More...
 
virtual IMessageFormatter GetFormatter ()
 Returns a formatter for the messages of the queue. More...
 
virtual void OnException (Exception ex)
 The on exception. More...
 
virtual void OnStart (MessageQueue messageQueue)
 The on start. More...
 
virtual void OnStop (MessageQueue messageQueue)
 The on stop. More...
 

Properties

string Path [get]
 returns the message queue format name More...
 
bool Stopped [get]
 Gets a value indicating whether Stopped. More...
 
virtual TimeSpan DispatchTimeout [get]
 Timeout for message processing, after timeout occurs a TimeoutException More...
 
virtual bool DoCreateMessageQueueIfNotExists [get]
 Gets a value indicating whether DoCreateMessageQueueIfNotExists. More...
 
abstract ILogger Log [get]
 Gets Log. More...
 
virtual int MaxDispatchTimeouts [get]
 reading stops if more timeouts occur at a time More...
 
virtual int MaxThreads [get]
 returns 1 if not overidden More...
 
virtual bool PurgeOnStart [get]
 set true to purge messages on start More...
 
virtual bool UsePeeking [get]
 Gets a value indicating whether to use MessageQueue.Peek() instead of MessageQueue.Receive() to receive messages. If UsePeeking is set to true, messages will not be lost if an error occurs during procession of the message. More...
 
virtual TimeSpan WaitTime [get]
 Gets the time the listening thread should wait for an incoming message until a MessageQueueException is thrown. More...
 

Detailed Description

Reads messages from MessageQueues and dispatches them

Constructor & Destructor Documentation

ExitGames.Messaging.MessageQueueReaderSingleThreaded.MessageQueueReaderSingleThreaded ( string  msmq)
inlineprotected

Initializes a new instance of the MessageQueueReaderSingleThreaded class.

Parameters
msmqThe path of the MessageQueue to which the reader thread should listen.

Member Function Documentation

void ExitGames.Messaging.MessageQueueReaderSingleThreaded.BeginStop ( )
inline

The begin stop.

abstract void ExitGames.Messaging.MessageQueueReaderSingleThreaded.DispatchMessage ( Message  message)
protectedpure virtual

Implementors should provide functionality to process the received message.

Parameters
messageThe message received by the message queue listen thread.
void ExitGames.Messaging.MessageQueueReaderSingleThreaded.Dispose ( )
inline

The dispose.

virtual void ExitGames.Messaging.MessageQueueReaderSingleThreaded.Dispose ( bool  disposing)
inlineprotectedvirtual

The dispose.

Parameters
disposingThe disposing.
bool ExitGames.Messaging.MessageQueueReaderSingleThreaded.EndStop ( int  waitSeconds)
inline

waits until reading stops or timeout expired

Parameters
waitSecondstimeout
Returns
true if stopped successfully, otherwise false
virtual IMessageFormatter ExitGames.Messaging.MessageQueueReaderSingleThreaded.GetFormatter ( )
inlineprotectedvirtual

Returns a formatter for the messages of the queue.

Returns
A BinaryMessageFormatter if method is not overriden.
virtual void ExitGames.Messaging.MessageQueueReaderSingleThreaded.OnException ( Exception  ex)
inlineprotectedvirtual

The on exception.

Parameters
exThe ex.
virtual void ExitGames.Messaging.MessageQueueReaderSingleThreaded.OnStart ( MessageQueue  messageQueue)
inlineprotectedvirtual

The on start.

Parameters
messageQueueThe message queue.
virtual void ExitGames.Messaging.MessageQueueReaderSingleThreaded.OnStop ( MessageQueue  messageQueue)
inlineprotectedvirtual

The on stop.

Parameters
messageQueueThe message queue.
void ExitGames.Messaging.MessageQueueReaderSingleThreaded.Start ( )
inline

Creates a listening thread and starts it. While running, the thread will listen to the specified message queue and dispatch incoming messages by calling the abstract method DispatchMessage. If UsePeeking is set to true, no messages will be lost if an error occurs during the procession of the message.

void ExitGames.Messaging.MessageQueueReaderSingleThreaded.Stop ( )
inline

Stops the reader thread, throws TimeoutException if not stopped within 1 minute.

bool ExitGames.Messaging.MessageQueueReaderSingleThreaded.Stop ( int  waitSeconds)
inline

Stops the reader thread.

Parameters
waitSecondsThe wait seconds.
Returns
The stop.

Property Documentation

virtual TimeSpan ExitGames.Messaging.MessageQueueReaderSingleThreaded.DispatchTimeout
getprotected

Timeout for message processing, after timeout occurs a TimeoutException

2 minutes if property is not overridden.

virtual bool ExitGames.Messaging.MessageQueueReaderSingleThreaded.DoCreateMessageQueueIfNotExists
getprotected

Gets a value indicating whether DoCreateMessageQueueIfNotExists.

abstract ILogger ExitGames.Messaging.MessageQueueReaderSingleThreaded.Log
getprotected

Gets Log.

virtual int ExitGames.Messaging.MessageQueueReaderSingleThreaded.MaxDispatchTimeouts
getprotected

reading stops if more timeouts occur at a time

default value is 9

virtual int ExitGames.Messaging.MessageQueueReaderSingleThreaded.MaxThreads
getprotected

returns 1 if not overidden

string ExitGames.Messaging.MessageQueueReaderSingleThreaded.Path
get

returns the message queue format name

virtual bool ExitGames.Messaging.MessageQueueReaderSingleThreaded.PurgeOnStart
getprotected

set true to purge messages on start

false if not overridden

bool ExitGames.Messaging.MessageQueueReaderSingleThreaded.Stopped
get

Gets a value indicating whether Stopped.

virtual bool ExitGames.Messaging.MessageQueueReaderSingleThreaded.UsePeeking
getprotected

Gets a value indicating whether to use MessageQueue.Peek() instead of MessageQueue.Receive() to receive messages. If UsePeeking is set to true, messages will not be lost if an error occurs during procession of the message.

true if MessageQueue.Peek should be used; false if MessageQueue.Receive should be used. Returns false if method is not overridden.

virtual TimeSpan ExitGames.Messaging.MessageQueueReaderSingleThreaded.WaitTime
getprotected

Gets the time the listening thread should wait for an incoming message until a MessageQueueException is thrown.

10 seconds if property is not overridden.