Server

class kanzi::connect::Server

A class that represents the Kanzi Connect server.

The server class can host multiple concurrent clients that have access to services registered to the server.

Public Functions

Server(const string configurationFilename, persistence::PersistenceFactoryInterface &persistenceFactory)

Constructor.

Parameters
  • configurationFile: Full path to configuration file.

  • persistenceFactory: Factory which is used to construct the backend of persistence service

Server(FileSet &fileset, persistence::PersistenceFactoryInterface &persistenceFactory)

Constructor.

Parameters
  • fileset: List of configuration files passed during construction.

  • persistenceFactory: Factory which is used to construct the backend of persistence service

Server(persistence::PersistenceFactoryInterface &persistenceFactory)

Constructor.

Constructs the absolute minimal server with just very few features enabled. The constructed server does not support HTTPS or SSL.

Parameters
  • persistenceFactory: Factory which is used to construct the backend of persistence service

~Server()

Destructor.

ConnectionManagerSharedPtr getConnectionManager()

Gets the server’s connection manager.

Return

Connection manager instance.

ContentManagerSharedPtr getContentManager()

Gets the server’s content manager.

Return

Content manager instance.

DiagnosticsManagerSharedPtr getDiagnosticsManager()

Gets the server’s diagnostics manager.

Return

Diagnostics manager instance.

ConnectDomain *getDomain()

Gets the server’s domain.

Return

Pointer to the domain. Ownership of the pointer is not transferred.

ServiceManagerSharedPtr getServiceManager()

Gets the server’s service manager.

Return

Service manager instance.

VirtualFileManagerSharedPtr getVirtualFileManager()

Gets the server’s HTTP virtual file manager.

Return

Virtual file manager instance.

WorkQueueInterface *getWorkQueueInterface()

Gets the interface that is used to access the work item queue.

Return

Pointer to the interface. Ownership of the pointer is not transferred.

void initialize(int threadcount = 3, bool enableHttpServer = true)

Initializes the server.

Parameters
  • threadcount: Number of worker threads to use to handle multithreaded services. A value of (numberOfCores - 1) usually provides the most efficient parallelism. The default number of worker threads is 3.

bool isConfigured()

Determines whether the server has been configured properly.

Return

Indicates whether the server has been configured properly.

bool processMessage()

Asks the server to perform work that was received while in idle loop.

Return

Indicates whether message processing continues.

void quit()

Quits message processing.

Causes processMessage() to return false.

void uninitialize()

Uninitializes the server.