Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

AbstractServer Class Reference

Inheritance diagram for AbstractServer:

IServer CacheServer ClusterServer HttpServer List of all members.

Public Member Functions

 this (InternetAddress bind, int threads, int backlog, ILogger logger=null)
void service (ServerThread thread, IConduit conduit)
char[] getRemoteAddress (IConduit conduit)
char[] getRemoteHost (IConduit conduit)
int getPort ()
char[] getHost ()
ILogger getLogger ()
void start ()

Protected Member Functions

abstract char[] toString ()
abstract ServerSocket createSocket (InternetAddress bind, int backlog)
abstract ServerThread createThread (ServerSocket socket)

Private Member Functions

char[] getProtocol ()

Private Attributes

InternetAddress bind
int threads
int backlog
ServerSocket socket
ILogger logger

Detailed Description

Exposes the foundation of a multi-threaded Socket server. This is subclassed by mango.http.server.HttpServer, which itself would likely be subclassed by a SecureHttpServer.

Definition at line 60 of file AbstractServer.d.


Member Function Documentation

this InternetAddress  bind,
int  threads,
int  backlog,
ILogger  logger = null
[inline]
 

Setup this server with the requisite attributes. The number of threads specified dictate exactly that. You might have anything between 1 thread and several hundred, dependent upon the underlying O/S and hardware.

Parameter 'backlog' specifies the max number of"simultaneous" connection requests to be handled by an underlying socket implementation.

Definition at line 81 of file AbstractServer.d.

References backlog, bind, and threads.

abstract char [] toString  )  [protected, pure virtual]
 

Concrete server must expose a name

Implemented in ClusterServer, CacheServer, and HttpServer.

abstract ServerSocket createSocket InternetAddress  bind,
int  backlog
[protected, pure virtual]
 

Concrete server must expose a ServerSocket factory

Implemented in ClusterServer, CacheServer, and HttpServer.

Referenced by start().

abstract ServerThread createThread ServerSocket  socket  )  [protected, pure virtual]
 

Concrete server must expose a ServerThread factory

Implemented in ClusterServer, CacheServer, and HttpServer.

Referenced by start().

void service ServerThread  thread,
IConduit  conduit
 

Concrete server must expose a service handler

Reimplemented in ClusterServer, CacheServer, and HttpServer.

Referenced by ServerThread::run().

char [] getRemoteAddress IConduit  conduit  )  [inline]
 

Provide support for figuring out the remote address

Reimplemented from IServer.

Definition at line 134 of file AbstractServer.d.

References InternetAddress::toAddrString().

char [] getRemoteHost IConduit  conduit  )  [inline]
 

Provide support for figuring out the remote host. Not currently implemented.

Reimplemented from IServer.

Definition at line 151 of file AbstractServer.d.

int getPort  )  [inline]
 

Return the local port we're attached to

Reimplemented from IServer.

Definition at line 162 of file AbstractServer.d.

References InternetAddress::port().

char [] getHost  )  [inline]
 

Return the local address we're attached to

Reimplemented from IServer.

Definition at line 174 of file AbstractServer.d.

References InternetAddress::toAddrString().

ILogger getLogger  )  [inline]
 

Return the logger associated with this server

Definition at line 186 of file AbstractServer.d.

Referenced by ServerThread::run(), CacheServer::LoaderThread::this(), and ClusterServer::this().

void start  )  [inline]
 

Start this server

Reimplemented in ClusterServer.

Definition at line 197 of file AbstractServer.d.

References backlog, bind, createSocket(), createThread(), ILogger::info(), and threads.

Referenced by TaskServer::start(), ClusterServer::start(), and testServer().

char [] getProtocol  )  [inherited]
 

Return the protocol in use.

Reimplemented in ClusterServer, CacheServer, and HttpServer.

Referenced by HttpRequest::getServerScheme().


Member Data Documentation

InternetAddress bind [private]
 

Definition at line 62 of file AbstractServer.d.

Referenced by start(), and this().

int threads [private]
 

Definition at line 63 of file AbstractServer.d.

Referenced by start(), and this().

int backlog [private]
 

Definition at line 64 of file AbstractServer.d.

Referenced by start(), and this().

ServerSocket socket [private]
 

Definition at line 65 of file AbstractServer.d.

Referenced by ServerThread::this().

ILogger logger [private]
 

Definition at line 66 of file AbstractServer.d.


The documentation for this class was generated from the following file:
Generated on Sun Nov 7 19:06:59 2004 for Mango by doxygen 1.3.6