Class SoMessageListener
Message listener used for listening to SuperOffice messages.
Implements
Inherited Members
Namespace: SuperOffice.Messaging
Assembly: SoDataBase.dll
Syntax
public class SoMessageListener : IDisposable
Constructors
SoMessageListener(IPEndPoint, Boolean, SoMessageRecieved)
Initialize a new message listener.
Declaration
public SoMessageListener(IPEndPoint endPoint, bool scanForPort, SoMessageRecieved onSoMessageRecieved)
Parameters
Type | Name | Description |
---|---|---|
IPEndPoint | endPoint | End point to listen for messages on. |
Boolean | scanForPort | True if the message listener should scan for an available port to listen on. |
SoMessageRecieved | onSoMessageRecieved | Call-back called when messages are recieved. |
Properties
EndPoint
End point the message listener is listening on.
Declaration
public IPEndPoint EndPoint { get; }
Property Value
Type | Description |
---|---|
IPEndPoint |
State
State of the message listener.
Declaration
public SoMessageListener.ListeningState State { get; set; }
Property Value
Type | Description |
---|---|
SoMessageListener.ListeningState |
Methods
BindToSocket(ref IPEndPoint, Boolean)
Bind to socket using IPv4 UDP Data Gram.
Declaration
public static Socket BindToSocket(ref IPEndPoint endPoint, bool scanForPort)
Parameters
Type | Name | Description |
---|---|---|
IPEndPoint | endPoint | End point associated with the socket |
Boolean | scanForPort | True to scan for availaple ports in higher ranges |
Returns
Type | Description |
---|---|
Socket | Socket bound to the provided port |
Dispose()
Dispose the message listener.
Declaration
public void Dispose()
Start()
Start the message listener.
Declaration
protected virtual void Start()
Stop()
Stop the message listener.
Declaration
protected virtual void Stop()
StopAllListeners()
Stop all message listeners within the process.
Declaration
public static void StopAllListeners()