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 the entire Remoting SDK Server Configuration System 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 connnectivity componens are needed to be used instead of predefined ones (f.e. the CreateJavaScriptDispatcher method could be overridden to instantiate the JavaScriptHttpDispatcher Class (Data Abstract) class instance instead of the default JavaScriptHttpDispatcher Class (Remoting SDK) one).

This class implements the INetworkServer interface.

Location

Implements

 

constructor

Creates a new instance of the NetworkServer class.

 

constructor

 

NetworkServer()

 

Sub New

add_Started

 

method add_Started(value: EventHandler)

 

void add_Started(EventHandler value)

 

Sub add_Started(value As EventHandler)

Parameters:

  • value:

add_Starting

 

method add_Starting(value: EventHandler)

 

void add_Starting(EventHandler value)

 

Sub add_Starting(value As EventHandler)

Parameters:

  • value:

add_Stopped

 

method add_Stopped(value: EventHandler)

 

void add_Stopped(EventHandler value)

 

Sub add_Stopped(value As EventHandler)

Parameters:

  • value:

add_Stopping

 

method add_Stopping(value: EventHandler)

 

void add_Stopping(EventHandler value)

 

Sub add_Stopping(value As EventHandler)

Parameters:

  • value:

AfterConfiguration  protected

This method is invoked right after the server configuration is loaded and all network connectivity components are instantiated.

It is the best place to add the code to fine-tune the instantiated network connectivity components. Implementation of this method in the %NetworkServer%% class is empty, so it should be overridden in the descended classes if needed.

 

method AfterConfiguration

 

void AfterConfiguration()

 

Sub AfterConfiguration

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

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; }

 

Property ReadOnly 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

remove_Started

 

method remove_Started(value: EventHandler)

 

void remove_Started(EventHandler value)

 

Sub remove_Started(value As EventHandler)

Parameters:

  • value:

remove_Starting

 

method remove_Starting(value: EventHandler)

 

void remove_Starting(EventHandler value)

 

Sub remove_Starting(value As EventHandler)

Parameters:

  • value:

remove_Stopped

 

method remove_Stopped(value: EventHandler)

 

void remove_Stopped(EventHandler value)

 

Sub remove_Stopped(value As EventHandler)

Parameters:

  • value:

remove_Stopping

 

method remove_Stopping(value: EventHandler)

 

void remove_Stopping(EventHandler value)

 

Sub remove_Stopping(value As EventHandler)

Parameters:

  • value:

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; }

 

Property ReadOnly 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; }

 

Property ReadOnly ServerMessages As IList<IMessage>

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

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; }

 

Property ReadOnly 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; }

 

Property ReadOnly 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; }

 

Property ReadOnly ServerMessages As IList<IMessage>

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

add_Started

 

method add_Started(value: EventHandler)

 

void add_Started(EventHandler value)

 

Sub add_Started(value As EventHandler)

Parameters:

  • value:

add_Starting

 

method add_Starting(value: EventHandler)

 

void add_Starting(EventHandler value)

 

Sub add_Starting(value As EventHandler)

Parameters:

  • value:

add_Stopped

 

method add_Stopped(value: EventHandler)

 

void add_Stopped(EventHandler value)

 

Sub add_Stopped(value As EventHandler)

Parameters:

  • value:

add_Stopping

 

method add_Stopping(value: EventHandler)

 

void add_Stopping(EventHandler value)

 

Sub add_Stopping(value As EventHandler)

Parameters:

  • value:

AfterConfiguration  protected

This method is invoked right after the server configuration is loaded and all network connectivity components are instantiated.

It is the best place to add the code to fine-tune the instantiated network connectivity components. Implementation of this method in the %NetworkServer%% class is empty, so it should be overridden in the descended classes if needed.

 

method AfterConfiguration

 

void AfterConfiguration()

 

Sub AfterConfiguration

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

remove_Started

 

method remove_Started(value: EventHandler)

 

void remove_Started(EventHandler value)

 

Sub remove_Started(value As EventHandler)

Parameters:

  • value:

remove_Starting

 

method remove_Starting(value: EventHandler)

 

void remove_Starting(EventHandler value)

 

Sub remove_Starting(value As EventHandler)

Parameters:

  • value:

remove_Stopped

 

method remove_Stopped(value: EventHandler)

 

void remove_Stopped(EventHandler value)

 

Sub remove_Stopped(value As EventHandler)

Parameters:

  • value:

remove_Stopping

 

method remove_Stopping(value: EventHandler)

 

void remove_Stopping(EventHandler value)

 

Sub remove_Stopping(value As EventHandler)

Parameters:

  • value:

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

See Also

  • INetworkServer
  • IServerConfiguration

  • Remoting SDK Server Configuration System