EHS Embedded HTTP Server  1.5.1.0
EHSServer Class Reference

EHSServer contains all the network related services for EHS. More...

#include <ehsserver.h>

Public Types

enum  ServerRunningStatus {
  SERVERRUNNING_INVALID = 0,
  SERVERRUNNING_NOTRUNNING,
  SERVERRUNNING_SINGLETHREADED,
  SERVERRUNNING_THREADPOOL,
  SERVERRUNNING_ONETHREADPERREQUEST,
  SERVERRUNNING_SHOULDTERMINATE
}
 Enumeration on the current running status of the EHSServer.
 

Public Member Functions

 EHSServer (EHS *ipoTopLevelEHS)
 Constucts a new instance. More...
 
virtual ~EHSServer ()
 Destructor.
 
void EndServerThread ()
 Stops the server. More...
 
void HandleData (int timeout, ehs_threadid_t tid=0)
 Main method that deals with client connections and getting data. More...
 
ServerRunningStatus RunningStatus () const
 Retrieves the current running status of this instance. More...
 
bool AcceptedNewConnection () const
 Retrieve accept status. More...
 
int RequestsPending () const
 Returns number of requests pending.
 

Static Public Member Functions

static void * PthreadHandleData_ThreadedStub (void *ipData)
 Static pthread worker. More...
 

Friends

class EHSConnection
 

Detailed Description

EHSServer contains all the network related services for EHS.

It is responsible for accepting new connections and getting EHSConnection objects set up.

Definition at line 34 of file ehsserver.h.

Constructor & Destructor Documentation

◆ EHSServer()

EHSServer ( EHS ipoTopLevelEHS)

Constucts a new instance.

Takes parameters out of the parent's EHSServerParameters.

Parameters
ipoTopLevelEHSThe parent EHS instance.

Member Function Documentation

◆ AcceptedNewConnection()

bool AcceptedNewConnection ( ) const
inline

Retrieve accept status.

Returns
true if this instance just has accepted a new connection.

Definition at line 87 of file ehsserver.h.

◆ EndServerThread()

void EndServerThread ( )

Stops the server.

This method blocks, until all server threads have terminated.

◆ HandleData()

void HandleData ( int  timeout,
ehs_threadid_t  tid = 0 
)

Main method that deals with client connections and getting data.

Parameters
timeoutselect timeout in milliseconds.
tidThread Id of the thread calling this method.

◆ PthreadHandleData_ThreadedStub()

static void* PthreadHandleData_ThreadedStub ( void *  ipData)
static

Static pthread worker.

Required by pthread as thread routine.

Parameters
ipDataOpaque pointer to this instance.

Referenced by RequestsPending().

+ Here is the caller graph for this function:

◆ RunningStatus()

ServerRunningStatus RunningStatus ( ) const
inline

Retrieves the current running status of this instance.

Returns
The current status.

Definition at line 81 of file ehsserver.h.


The documentation for this class was generated from the following file: