The C++ framework for developing highly scalable, high performance servers on Windows platforms.

IServerControl Class Reference
[Interfaces]

Inheritance diagram for IServerControl:

List of all members.


Detailed Description

An interface to a 'server' that can be started, stopped and can be toggled between accepting connections or not. The life-cycle of an object that implements this interface is; start, accept connections, stop accepting connections, initiate shutdown, shutdown. The object may go from accepting to not accepting and back again any number of times after being started. The object may go from started to stopped and stopped to started any number of times.

Public Types

enum  Status {
  NotStarted, AcceptingConnections, Paused, ShuttingDown,
  Stopped, Indeterminate
}

Public Member Functions

virtual ~IServerControl ()
 Instances of this interface can be deleted by their users.
virtual void Start ()=0
virtual void StartAcceptingConnections ()=0
virtual void StopAcceptingConnections ()=0
virtual void BeginShutdown ()=0
 Starts the shutdown process and returns immediately.
virtual void WaitForShutdownToComplete ()=0
 Initiates a shutdown (if one isn't already in progresss) and then waits for it to complete. Does not return until the shutdown has completed.
virtual bool WaitForShutdownToComplete (Milliseconds timeout)=0
 Initiates a shutdown (if one isn't already in progresss) and then waits for the supplied number of milliseconds for it to complete. Returns true if the shutdown completed successfully before the timeout expired and false if it didn't.
virtual void ForceShutdown ()=0
 If a shutdown is hung due to sockets still being active then you can force a shutdown to complete by calling this function. Note: USE WITH CARE!!! The usual usage pattern is to call WaitForShutdownToComplete() with a timeout and if that fails then to call ForceShutdown() to allow the object in question to be destroyed (in general the object would call WaitForShutdownToComplete() in its destructor and hang there!).
virtual Status GetStatus () const =0
 Returns the status of the server.

Static Public Member Functions

static
JetByteTools::Core::_tstring 
GetStatusAsString (Status status)

Member Enumeration Documentation

enum Status

Enumerator:
NotStarted 
AcceptingConnections 
Paused 
ShuttingDown 
Stopped 
Indeterminate 


Constructor & Destructor Documentation

virtual ~IServerControl (  )  [virtual]

Instances of this interface can be deleted by their users.


Member Function Documentation

virtual void BeginShutdown (  )  [pure virtual]

virtual void WaitForShutdownToComplete (  )  [pure virtual]

Initiates a shutdown (if one isn't already in progresss) and then waits for it to complete. Does not return until the shutdown has completed.

Implemented in TDatagramSocketServer, CNamedServerCollection, CServerCollection, TStreamSocketServer, TStreamSocketServerEx, and TStreamSocketServerEx< TStreamSocketConnectionManager< CFilteringStreamSocketConnectionManagerBase > >.

virtual bool WaitForShutdownToComplete ( Milliseconds  timeout  )  [pure virtual]

Initiates a shutdown (if one isn't already in progresss) and then waits for the supplied number of milliseconds for it to complete. Returns true if the shutdown completed successfully before the timeout expired and false if it didn't.

Implemented in TDatagramSocketServer, CNamedServerCollection, CServerCollection, TStreamSocketServer, TStreamSocketServerEx, and TStreamSocketServerEx< TStreamSocketConnectionManager< CFilteringStreamSocketConnectionManagerBase > >.

virtual void ForceShutdown (  )  [pure virtual]

If a shutdown is hung due to sockets still being active then you can force a shutdown to complete by calling this function. Note: USE WITH CARE!!! The usual usage pattern is to call WaitForShutdownToComplete() with a timeout and if that fails then to call ForceShutdown() to allow the object in question to be destroyed (in general the object would call WaitForShutdownToComplete() in its destructor and hang there!).

Implemented in TDatagramSocketServer, CNamedServerCollection, CServerCollection, TStreamSocketServer, TStreamSocketServerEx, and TStreamSocketServerEx< TStreamSocketConnectionManager< CFilteringStreamSocketConnectionManagerBase > >.

_tstring GetStatusAsString ( Status  status  )  [static]


Generated on Sun Sep 12 19:10:27 2021 for The Server Framework - v7.4 by doxygen 1.5.3