|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NLNET::IService Class ReferenceBase class for all network services.
More...
#include <service.h>
Inheritance diagram for NLNET::IService
[legend]Collaboration diagram for NLNET::IService:
[legend]List of all members.
Detailed Description
Base class for all network services.
You must inherite from this class to create your own service. You must not create ctor and dtor but implement init() and release() methods. You have to create a global callback array called CallbackArray.
service_howto
Temporary command line arguments :
- Arg 1 : port number for listening
- Arg 2 : (optional) timeout for select in millisecond
-
Author(s):
-
Vianney Lecroart , Olivier Cado , Nevrax France
-
Date:
-
2000
Definition at line 101 of file service.h.
Constructor & Destructor Documentation
NLNET::IService::IService (
|
)
|
|
NLNET::IService::~IService (
|
) [inline, virtual]
|
|
Member Function Documentation
void NLNET::IService::getCustomParams (
|
) [protected]
|
|
|
Process command line arguments for port and timeout.
Definition at line 180 of file service.cpp. |
sint NLNET::IService::getStatus (
|
) [inline]
|
|
|
Returns the status.
Definition at line 126 of file service.h. |
void NLNET::IService::init (
|
void ) [inline, virtual]
|
|
sint NLNET::IService::main (
|
int argc,
|
|
char ** argv )
|
|
|
User must just have to call this function in his main C function.
Definition at line 272 of file service.cpp. |
void NLNET::IService::release (
|
void ) [inline, virtual]
|
|
|
Returns the service identifier.
Definition at line 123 of file service.h. |
std::string NLNET::IService::serviceName (
|
) [inline, static]
|
|
|
Returns the current service name.
Definition at line 120 of file service.h. |
void NLNET::IService::setCallbackArray (
|
TCallbackItem * callbackArray,
|
|
uint16 callbackArraySize ) [inline]
|
|
void NLNET::IService::setPort (
|
uint16 Port ) [inline, static]
|
|
|
Sets the service identifier.
Definition at line 177 of file service.h. |
void NLNET::IService::setServiceName (
|
const char * shortName,
|
|
const char * longName ) [inline, static]
|
|
void NLNET::IService::setStatus (
|
sint status ) [inline]
|
|
|
Set the status of the service, this status is return to the application. EXIT_SUCCESS is the default status You can set it to EXIT_FAILURE or any value you want. It's useful when you use the service in a script and you want to know the return value of the application to do the appropriate things.
Definition at line 131 of file service.h. |
void NLNET::IService::setUpdateTimeout (
|
uint32 timeout ) [inline, static]
|
|
|
Select timeout value in milliseconds for each update.
If you set the value to 1000, the user update function will be call every second. By default the value is 1
Definition at line 143 of file service.h. |
bool NLNET::IService::update (
|
) [inline, virtual]
|
|
Friends And Related Function Documentation
void AESConnection (
|
const std::string & serviceName,
|
|
TSockId from,
|
|
void * arg ) [friend]
|
|
Member Data Documentation
CConfigFile NLNET::IService::ConfigFile [static]
|
|
IService * NLNET::IService::Instance = NULL [static, protected]
|
|
std::vector< std::string > NLNET::IService::_Args [protected]
|
|
|
Array of arguments.
Definition at line 155 of file service.h. |
uint16 NLNET::IService::_CallbackArraySize [private]
|
|
uint16 NLNET::IService::_DefaultPort = 0 [static, protected]
|
|
|
Current service default port. Must be set by the deriver class.
Definition at line 76 of file service.cpp. |
bool NLNET::IService::_Initialized [private]
|
|
string NLNET::IService::_LongName = "" [static, protected]
|
|
uint16 NLNET::IService::_Port [protected]
|
|
|
Port for listening.
Definition at line 158 of file service.h. |
string NLNET::IService::_ShortName = "" [static, protected]
|
|
|
Current service name. Is set by the actual service when declaring NLNET_SERVICE_MAIN.
Definition at line 74 of file service.cpp. |
sint NLNET::IService::_Status [private]
|
|
uint32 NLNET::IService::_UpdateTimeout = 1 [static, private]
|
|
|
Select timeout value in milliseconds.
Definition at line 78 of file service.cpp. |
The documentation for this class was generated from the following files:
|
|