|
ImagingTools Core SDK
|
Interface for managing the lifecycle of multi-protocol servers. More...
#include <IServerDispatcher.h>
Public Member Functions | |
| virtual bool | StartServer (IServerConnectionInterface::ProtocolType protocolType)=0 |
| Start a server for the specified protocol. | |
| virtual bool | StopServer (IServerConnectionInterface::ProtocolType protocolType)=0 |
| Stop the server for the specified protocol. | |
| virtual imtrest::IServer::ServerStatus | GetServerStatus (IServerConnectionInterface::ProtocolType protocolType) const =0 |
| Query the operational status of a server. | |
| virtual IServerConnectionInterface::ProtocolTypes | GetSupportedProtocols () const =0 |
| Get the list of protocols supported by this dispatcher. | |
Interface for managing the lifecycle of multi-protocol servers.
The IServerDispatcher provides control over server instances that can support multiple communication protocols (HTTP, WebSocket, gRPC). It enables starting, stopping, and querying the status of protocol-specific server implementations.
This interface acts as a facade for managing underlying server components (typically from the imtrest module), providing a unified API for multi-protocol server orchestration.
Multi-Protocol Management:
Server Lifecycle:
Protocol Discovery:
Servers progress through the following states (from imtrest::IServer::ServerStatus):
Server Components (imtrest):
Configuration:
Client Modules:
Definition at line 120 of file IServerDispatcher.h.
|
pure virtual |
Query the operational status of a server.
Returns the current status of the server implementation for the specified protocol. The status indicates whether the server is stopped, starting, running, or stopping.
| protocolType | The protocol type to query (PT_HTTP, PT_WEBSOCKET, etc.). |
|
pure virtual |
Get the list of protocols supported by this dispatcher.
Returns all protocol types that this dispatcher implementation can manage. Only protocols in this list can be passed to StartServer(), StopServer(), and GetServerStatus().
The list is typically static and defined by the dispatcher implementation. For example, CServerDispatcherComp supports PT_HTTP and PT_WEBSOCKET.
|
pure virtual |
Start a server for the specified protocol.
Initializes and starts the server implementation for the given protocol. The server will begin listening on the port configured in the associated IServerConnectionInterface.
If the server is already running, this method may return true without restarting it (implementation-dependent).
| protocolType | The protocol type to start (PT_HTTP, PT_WEBSOCKET, etc.). |
true if the server was started successfully or was already running; false if startup failed (e.g., port already in use, configuration invalid).
|
pure virtual |
Stop the server for the specified protocol.
Gracefully shuts down the server implementation for the given protocol. The server will stop accepting new connections and may wait for active connections to complete (implementation-dependent).
If the server is already stopped, this method typically returns true without error.
| protocolType | The protocol type to stop (PT_HTTP, PT_WEBSOCKET, etc.). |
true if the server was stopped successfully or was already stopped; false if shutdown failed.