NetworkServer

Overview

The NetworkServer class ties together the network connectivity components like server channel, messages etc grouping them together into single configurable class. The NetworkServer is the core of a Remoting SDK Server application as it holds the server connectivity components and implement their configuration logic.

In most cases this class is used AS IS. However it might be needed to use a class descended from the NetworkServer class, f.e. in cases where custom server channels or other server connectivity components are needed to be used instead of predefined ones (f.e. the CreateJavaScriptDispatcher method could be overridden to instantiate the JavaScriptHttpDispatcher class instance instead of the default JavaScriptHttpDispatcher one).

This class implements the INetworkServer interface.

Location


 

constructor

Creates a new instance of the NetworkServer class.

 

constructor

 

NetworkServer()

 

Sub New()

ApiDispatcher

 

property ApiDispatcher: HttpApiDispatcher read write;

 

HttpApiDispatcher ApiDispatcher { get; set; }

 

Property ApiDispatcher() As HttpApiDispatcher

Certificate

 

property Certificate: X509Certificate2 read write;

 

X509Certificate2 Certificate { get; set; }

 

Property Certificate() As X509Certificate2

CertificateFileName

 

property CertificateFileName: String read write;

 

String CertificateFileName { get; set; }

 

Property CertificateFileName() As String

CertificateStore

 

property CertificateStore: String read write;

 

String CertificateStore { get; set; }

 

Property CertificateStore() As String

CertificateSubject

 

property CertificateSubject: String read write;

 

String CertificateSubject { get; set; }

 

Property CertificateSubject() As String

CertificateThumbprint

 

property CertificateThumbprint: String read write;

 

String CertificateThumbprint { get; set; }

 

Property CertificateThumbprint() As String

CertificateWatcherCallback  protected

 

method CertificateWatcherCallback(certificate: X509Certificate2)

 

void CertificateWatcherCallback(X509Certificate2 certificate)

 

Sub CertificateWatcherCallback(certificate As X509Certificate2)

Parameters:

  • certificate:

CreateCustomMessage  protected

Instantiates a custom server message.

This method is called when a Custom message type is defined in the server configuration. Note that the provided configuration might not provide all the information needed to properly configure the message being instantiated so this method might require additional configuration information.

Implementation of this method in the NetworkServer class raises an NotImplementedException exception.

 

method CreateCustomMessage(configuration: IServerMessageConfiguration): Message

 

Message CreateCustomMessage(IServerMessageConfiguration configuration)

 

Function CreateCustomMessage(configuration As IServerMessageConfiguration) As Message

Parameters:

  • configuration: Component configuration

CreateCustomMessageQueue  protected

Instantiates a custom message queue manager used by the EventSinkManager.

This method is called when a Custom session manager type is defined in the server configuration. Note that the provided configuration might not provide all the information needed to properly configure the message queue manage being instantiated so this method might require additional configuration information.

Implementation of this method in the NetworkServer class raises an NotImplementedException exception.

 

method CreateCustomMessageQueue(configuration: ISessionManagerConfiguration): MessageQueueManager

 

MessageQueueManager CreateCustomMessageQueue(ISessionManagerConfiguration configuration)

 

Function CreateCustomMessageQueue(configuration As ISessionManagerConfiguration) As MessageQueueManager

Parameters:

  • configuration: Component configuration

CreateCustomServerChannel  protected

Instantiates a custom server channel.

This method is called when a Custom server channel type is defined in the server configuration. Note that the provided configuration might not provide all the information needed to properly configure the server channel being instantiated so this method might require additional configuration information.

Implementation of this method in the NetworkServer class raises an NotImplementedException exception.

 

method CreateCustomServerChannel(configuration: IServerChannelConfiguration): ServerChannel

 

ServerChannel CreateCustomServerChannel(IServerChannelConfiguration configuration)

 

Function CreateCustomServerChannel(configuration As IServerChannelConfiguration) As ServerChannel

Parameters:

  • configuration: Component configuration

CreateCustomSessionManager  protected

Instantiates a custom session manager.

This method is called when a Custom session manager type is defined in the server configuration. Note that the provided configuration might not provide all the information needed to properly configure the session manager being instantiated so this method might require additional configuration information.

Implementation of this method in the NetworkServer class raises an NotImplementedException exception.

 

method CreateCustomSessionManager(configuration: ISessionManagerConfiguration): SessionManager

 

SessionManager CreateCustomSessionManager(ISessionManagerConfiguration configuration)

 

Function CreateCustomSessionManager(configuration As ISessionManagerConfiguration) As SessionManager

Parameters:

  • configuration: Component configuration

EnableZeroConf

 

property EnableZeroConf: Boolean read write;

 

Boolean EnableZeroConf { get; set; }

 

Property EnableZeroConf() As Boolean

EventManager

Gets the EventSinkManager instance being used by the Network Server.

 

property EventManager: EventSinkManager read write;

 

EventSinkManager EventManager { get; set; }

 

Property EventManager() As EventSinkManager

IsActive

 

property IsActive: Boolean read;

 

Boolean IsActive { get; }

 

ReadOnly Property IsActive() As Boolean

JavaScriptDispatcher

Gets the JavaScriptHttpDispatcher instance being used by the Network Server.

 

property JavaScriptDispatcher: JavaScriptHttpDispatcher read write;

 

JavaScriptHttpDispatcher JavaScriptDispatcher { get; set; }

 

Property JavaScriptDispatcher() As JavaScriptHttpDispatcher

MessageQueue

Gets the MessageQueueManager instance being used by the Network Server.

 

property MessageQueue: MessageQueueManager read write;

 

MessageQueueManager MessageQueue { get; set; }

 

Property MessageQueue() As MessageQueueManager

OnStarted  protected

 

method OnStarted

 

void OnStarted()

 

Sub OnStarted()

OnStarting  protected

 

method OnStarting

 

void OnStarting()

 

Sub OnStarting()

OnStopped  protected

 

method OnStopped

 

void OnStopped()

 

Sub OnStopped()

OnStopping  protected

 

method OnStopping

 

void OnStopping()

 

Sub OnStopping()

Port

 

property Port: Int32 read write;

 

Int32 Port { get; set; }

 

Property Port() As Int32

RegisterServerMessage

 

method RegisterServerMessage(message: IMessage)

 

void RegisterServerMessage(IMessage message)

 

Sub RegisterServerMessage(message As IMessage)

Parameters:

  • message:

RegisterZeroConfService  protected

Register all services provided by the server application in the ZeroConf environment.

Override this method in cases when more advanced control over the ZeroConf registration process is needed.

 

method RegisterZeroConfService

 

void RegisterZeroConfService()

 

Sub RegisterZeroConfService()

ServerChannel

Gets the ServerChannel instance being used by the Network Server.

 

property ServerChannel: ServerChannel read write;

 

ServerChannel ServerChannel { get; set; }

 

Property ServerChannel() As ServerChannel

ServerMessage

 

property ServerMessage: IMessage read;

 

IMessage ServerMessage { get; }

 

ReadOnly Property ServerMessage() As IMessage

ServerMessages

Gets list of the Message instances being used by the Network Server.

 

property ServerMessages: IList<IMessage> read;

 

IList<IMessage> ServerMessages { get; }

 

ReadOnly Property ServerMessages() As IList<IMessage>

ServiceGroup

Allows to get/set Service Groups

 

property ServiceGroup: String read write;

 

String ServiceGroup { get; set; }

 

Property ServiceGroup() As String

SessionManager

Gets the SessionManager instance being used by the Network Server.

 

property SessionManager: SessionManager read write;

 

SessionManager SessionManager { get; set; }

 

Property SessionManager() As SessionManager

SetCertificateWatcher

 

method SetCertificateWatcher(watcherFactory: ICertificateWatcherFactory)

 

void SetCertificateWatcher(ICertificateWatcherFactory watcherFactory)

 

Sub SetCertificateWatcher(watcherFactory As ICertificateWatcherFactory)

Parameters:

  • watcherFactory:

SetupConnectionSecurity

 

method SetupConnectionSecurity(certificate: X509Certificate2)

 

void SetupConnectionSecurity(X509Certificate2 certificate)

 

Sub SetupConnectionSecurity(certificate As X509Certificate2)

Parameters:

  • certificate:

SetupServer

 

method SetupServer(configuration: INetworkServerConfiguration)

 

void SetupServer(INetworkServerConfiguration configuration)

 

Sub SetupServer(configuration As INetworkServerConfiguration)

Parameters:

  • configuration:

Start

Starts the server and opens the server channel.

 

method Start

 

void Start()

 

Sub Start()

Started

 

event Started: EventHandler;

 

delegate EventHandler Started()

 

Event Started As EventHandler

Starting

 

event Starting: EventHandler;

 

delegate EventHandler Starting()

 

Event Starting As EventHandler

Stop

Closes the server channel and stops the server.

 

method Stop

 

void Stop()

 

Sub Stop()

Stopped

 

event Stopped: EventHandler;

 

delegate EventHandler Stopped()

 

Event Stopped As EventHandler

Stopping

 

event Stopping: EventHandler;

 

delegate EventHandler Stopping()

 

Event Stopping As EventHandler

UnregisterServerMessage

 

method UnregisterServerMessage(message: IMessage)

 

void UnregisterServerMessage(IMessage message)

 

Sub UnregisterServerMessage(message As IMessage)

Parameters:

  • message:

UnregisterZeroConfService  protected

Unregister all services provided by the server application from the ZeroConf environment.

Override this method in cases when more advanced control over the ZeroConf unregistration process is needed.

 

method UnregisterZeroConfService

 

void UnregisterZeroConfService()

 

Sub UnregisterZeroConfService()

UseTLS

 

property UseTLS: Boolean read write;

 

Boolean UseTLS { get; set; }

 

Property UseTLS() As Boolean

 

ApiDispatcher

 

property ApiDispatcher: HttpApiDispatcher read write;

 

HttpApiDispatcher ApiDispatcher { get; set; }

 

Property ApiDispatcher() As HttpApiDispatcher

Certificate

 

property Certificate: X509Certificate2 read write;

 

X509Certificate2 Certificate { get; set; }

 

Property Certificate() As X509Certificate2

CertificateFileName

 

property CertificateFileName: String read write;

 

String CertificateFileName { get; set; }

 

Property CertificateFileName() As String

CertificateStore

 

property CertificateStore: String read write;

 

String CertificateStore { get; set; }

 

Property CertificateStore() As String

CertificateSubject

 

property CertificateSubject: String read write;

 

String CertificateSubject { get; set; }

 

Property CertificateSubject() As String

CertificateThumbprint

 

property CertificateThumbprint: String read write;

 

String CertificateThumbprint { get; set; }

 

Property CertificateThumbprint() As String

EnableZeroConf

 

property EnableZeroConf: Boolean read write;

 

Boolean EnableZeroConf { get; set; }

 

Property EnableZeroConf() As Boolean

EventManager

Gets the EventSinkManager instance being used by the Network Server.

 

property EventManager: EventSinkManager read write;

 

EventSinkManager EventManager { get; set; }

 

Property EventManager() As EventSinkManager

IsActive

 

property IsActive: Boolean read;

 

Boolean IsActive { get; }

 

ReadOnly Property IsActive() As Boolean

JavaScriptDispatcher

Gets the JavaScriptHttpDispatcher instance being used by the Network Server.

 

property JavaScriptDispatcher: JavaScriptHttpDispatcher read write;

 

JavaScriptHttpDispatcher JavaScriptDispatcher { get; set; }

 

Property JavaScriptDispatcher() As JavaScriptHttpDispatcher

MessageQueue

Gets the MessageQueueManager instance being used by the Network Server.

 

property MessageQueue: MessageQueueManager read write;

 

MessageQueueManager MessageQueue { get; set; }

 

Property MessageQueue() As MessageQueueManager

Port

 

property Port: Int32 read write;

 

Int32 Port { get; set; }

 

Property Port() As Int32

ServerChannel

Gets the ServerChannel instance being used by the Network Server.

 

property ServerChannel: ServerChannel read write;

 

ServerChannel ServerChannel { get; set; }

 

Property ServerChannel() As ServerChannel

ServerMessage

 

property ServerMessage: IMessage read;

 

IMessage ServerMessage { get; }

 

ReadOnly Property ServerMessage() As IMessage

ServerMessages

Gets list of the Message instances being used by the Network Server.

 

property ServerMessages: IList<IMessage> read;

 

IList<IMessage> ServerMessages { get; }

 

ReadOnly Property ServerMessages() As IList<IMessage>

ServiceGroup

Allows to get/set Service Groups

 

property ServiceGroup: String read write;

 

String ServiceGroup { get; set; }

 

Property ServiceGroup() As String

SessionManager

Gets the SessionManager instance being used by the Network Server.

 

property SessionManager: SessionManager read write;

 

SessionManager SessionManager { get; set; }

 

Property SessionManager() As SessionManager

UseTLS

 

property UseTLS: Boolean read write;

 

Boolean UseTLS { get; set; }

 

Property UseTLS() As Boolean

 

constructor

Creates a new instance of the NetworkServer class.

 

constructor

 

NetworkServer()

 

Sub New()

CertificateWatcherCallback  protected

 

method CertificateWatcherCallback(certificate: X509Certificate2)

 

void CertificateWatcherCallback(X509Certificate2 certificate)

 

Sub CertificateWatcherCallback(certificate As X509Certificate2)

Parameters:

  • certificate:

CreateCustomMessage  protected

Instantiates a custom server message.

This method is called when a Custom message type is defined in the server configuration. Note that the provided configuration might not provide all the information needed to properly configure the message being instantiated so this method might require additional configuration information.

Implementation of this method in the NetworkServer class raises an NotImplementedException exception.

 

method CreateCustomMessage(configuration: IServerMessageConfiguration): Message

 

Message CreateCustomMessage(IServerMessageConfiguration configuration)

 

Function CreateCustomMessage(configuration As IServerMessageConfiguration) As Message

Parameters:

  • configuration: Component configuration

CreateCustomMessageQueue  protected

Instantiates a custom message queue manager used by the EventSinkManager.

This method is called when a Custom session manager type is defined in the server configuration. Note that the provided configuration might not provide all the information needed to properly configure the message queue manage being instantiated so this method might require additional configuration information.

Implementation of this method in the NetworkServer class raises an NotImplementedException exception.

 

method CreateCustomMessageQueue(configuration: ISessionManagerConfiguration): MessageQueueManager

 

MessageQueueManager CreateCustomMessageQueue(ISessionManagerConfiguration configuration)

 

Function CreateCustomMessageQueue(configuration As ISessionManagerConfiguration) As MessageQueueManager

Parameters:

  • configuration: Component configuration

CreateCustomServerChannel  protected

Instantiates a custom server channel.

This method is called when a Custom server channel type is defined in the server configuration. Note that the provided configuration might not provide all the information needed to properly configure the server channel being instantiated so this method might require additional configuration information.

Implementation of this method in the NetworkServer class raises an NotImplementedException exception.

 

method CreateCustomServerChannel(configuration: IServerChannelConfiguration): ServerChannel

 

ServerChannel CreateCustomServerChannel(IServerChannelConfiguration configuration)

 

Function CreateCustomServerChannel(configuration As IServerChannelConfiguration) As ServerChannel

Parameters:

  • configuration: Component configuration

CreateCustomSessionManager  protected

Instantiates a custom session manager.

This method is called when a Custom session manager type is defined in the server configuration. Note that the provided configuration might not provide all the information needed to properly configure the session manager being instantiated so this method might require additional configuration information.

Implementation of this method in the NetworkServer class raises an NotImplementedException exception.

 

method CreateCustomSessionManager(configuration: ISessionManagerConfiguration): SessionManager

 

SessionManager CreateCustomSessionManager(ISessionManagerConfiguration configuration)

 

Function CreateCustomSessionManager(configuration As ISessionManagerConfiguration) As SessionManager

Parameters:

  • configuration: Component configuration

OnStarted  protected

 

method OnStarted

 

void OnStarted()

 

Sub OnStarted()

OnStarting  protected

 

method OnStarting

 

void OnStarting()

 

Sub OnStarting()

OnStopped  protected

 

method OnStopped

 

void OnStopped()

 

Sub OnStopped()

OnStopping  protected

 

method OnStopping

 

void OnStopping()

 

Sub OnStopping()

RegisterServerMessage

 

method RegisterServerMessage(message: IMessage)

 

void RegisterServerMessage(IMessage message)

 

Sub RegisterServerMessage(message As IMessage)

Parameters:

  • message:

RegisterZeroConfService  protected

Register all services provided by the server application in the ZeroConf environment.

Override this method in cases when more advanced control over the ZeroConf registration process is needed.

 

method RegisterZeroConfService

 

void RegisterZeroConfService()

 

Sub RegisterZeroConfService()

SetCertificateWatcher

 

method SetCertificateWatcher(watcherFactory: ICertificateWatcherFactory)

 

void SetCertificateWatcher(ICertificateWatcherFactory watcherFactory)

 

Sub SetCertificateWatcher(watcherFactory As ICertificateWatcherFactory)

Parameters:

  • watcherFactory:

SetupConnectionSecurity

 

method SetupConnectionSecurity(certificate: X509Certificate2)

 

void SetupConnectionSecurity(X509Certificate2 certificate)

 

Sub SetupConnectionSecurity(certificate As X509Certificate2)

Parameters:

  • certificate:

SetupServer

 

method SetupServer(configuration: INetworkServerConfiguration)

 

void SetupServer(INetworkServerConfiguration configuration)

 

Sub SetupServer(configuration As INetworkServerConfiguration)

Parameters:

  • configuration:

Start

Starts the server and opens the server channel.

 

method Start

 

void Start()

 

Sub Start()

Stop

Closes the server channel and stops the server.

 

method Stop

 

void Stop()

 

Sub Stop()

UnregisterServerMessage

 

method UnregisterServerMessage(message: IMessage)

 

void UnregisterServerMessage(IMessage message)

 

Sub UnregisterServerMessage(message As IMessage)

Parameters:

  • message:

UnregisterZeroConfService  protected

Unregister all services provided by the server application from the ZeroConf environment.

Override this method in cases when more advanced control over the ZeroConf unregistration process is needed.

 

method UnregisterZeroConfService

 

void UnregisterZeroConfService()

 

Sub UnregisterZeroConfService()

 

Started

 

event Started: EventHandler;

 

delegate EventHandler Started()

 

Event Started As EventHandler

Starting

 

event Starting: EventHandler;

 

delegate EventHandler Starting()

 

Event Starting As EventHandler

Stopped

 

event Stopped: EventHandler;

 

delegate EventHandler Stopped()

 

Event Stopped As EventHandler

Stopping

 

event Stopping: EventHandler;

 

delegate EventHandler Stopping()

 

Event Stopping As EventHandler