omegalib
13.1
|
Implements a Tcp server. More...
#include <Tcp.h>
Public Member Functions | |
TcpServer () | |
~TcpServer () | |
void | setPort (int value) |
int | getPort () |
virtual void | initialize () |
virtual void | start () |
virtual void | stop () |
virtual void | poll () |
TcpConnection * | getConnection (int id) |
Public Member Functions inherited from omicron::Service | |
Service () | |
int | getServiceId () |
virtual | ~Service () |
ServiceManager * | getManager () |
String | getName () |
bool | isInitialized () |
bool | isDebugEnabled () |
Returns true if debug mode is enabled for this service. More... | |
ServicePollPriority | getPollPriority () |
void | setPollPriority (ServicePollPriority value) |
virtual void | setup (Setting &settings) |
virtual void | dispose () |
void | lockEvents () |
void | unlockEvents () |
Event * | writeHead () |
Event * | readHead () |
Event * | readTail () |
Event * | getEvent (int index) |
void | doSetup (ServiceManager *mng, Setting &settings) |
void | doInitialize (ServiceManager *sm, int serviceId) |
Public Member Functions inherited from omicron::ReferenceType | |
ReferenceType () | |
virtual | ~ReferenceType () |
void | ref () |
void | unref () |
long | refCount () |
Protected Member Functions | |
virtual TcpConnection * | createConnection (const ConnectionInfo &ci) |
Called when a new client connected. More... | |
virtual void | accept () |
virtual void | handleAccept (TcpConnection *newConnection, const asio::error_code &error) |
Additional Inherited Members | |
Public Types inherited from omicron::Service | |
enum | ServiceType { Pointer = EventBase::ServiceTypePointer, Mocap = EventBase::ServiceTypeMocap, Keyboard = EventBase::ServiceTypeKeyboard, Controller = EventBase::ServiceTypeController, Ui = EventBase::ServiceTypeUi, Generic = EventBase::ServiceTypeGeneric, Brain = EventBase::ServiceTypeBrain, Wand = EventBase::ServiceTypeWand, Speech = EventBase::ServiceTypeSpeech } |
This enumeration is kept for compatibility reason and may be removed in the future. More... | |
enum | ServicePollPriority { PollFirst, PollNormal, PollLast } |
Static Public Member Functions inherited from omicron::ReferenceType | |
static void | printObjCounts () |
Static Protected Attributes inherited from omicron::ReferenceType | |
static List< ReferenceType * > | mysObjList |
Implements a Tcp server.
The server listens to client connections and handles communication with each client. To implement custom servers, users derive the TcpServer class and reimplement the createConnection method, to create custom TcpConnection instances That contains the user-defined communication logic (see TcpConnection). The TcpServer is implemented as an omicron service, so it will run automatically in the background when users register it with ServiceManager. TcpServer can also be used without ServiceManager, by calling the intialize(), start(), stop() and poll() methods directly.
omicron::TcpServer::TcpServer | ( | ) |
omicron::TcpServer::~TcpServer | ( | ) |
|
protectedvirtual |
|
protectedvirtual |
Called when a new client connected.
Creates a TcpConnection instance to handle communication User code should reimplement this method.
Reimplemented in omega::MissionControlServer, and omicron::AssetCacheService.
TcpConnection* omicron::TcpServer::getConnection | ( | int | id | ) |
|
inline |
|
protectedvirtual |
|
virtual |
Reimplemented from omicron::Service.
Reimplemented in omega::MissionControlServer, and omicron::AssetCacheService.
|
virtual |
Reimplemented from omicron::Service.
|
inline |
|
virtual |
Reimplemented from omicron::Service.
|
virtual |
Reimplemented from omicron::Service.