C++ Service wrapper Manages the service's connections.
More...
#include <football.h>
C++ Service wrapper Manages the service's connections.
◆ ServiceBase()
Create a new service with requested options.
Creates the underlying standard C stuff, and a C++ object that wraps it.
- Parameters
-
| options | The service options such as ports, behavior settings, etc. |
| parent | A parent service whose service port(s) the child will share. |
- See also
- fb_create_service ()
◆ ~ServiceBase()
| Football::ServiceBase::~ServiceBase |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ allocNewConnection()
| virtual Connection* Football::ServiceBase::allocNewConnection |
( |
| ) |
|
|
protectedpure virtual |
◆ close()
| void Football::ServiceBase::close |
( |
void |
| ) |
|
Initiate shutdown of a service.
◆ conditional_print()
| ssize_t Football::ServiceBase::conditional_print |
( |
bool(*)(FB_CONNECTION *) |
callback, |
|
|
const std::string & |
message |
|
) |
| |
|
overridevirtual |
◆ getFromOld()
Retrieve a C++ service object from the old C-style service structure.
- Parameters
-
| service | The old standard C service structure. |
- Returns
- The C++ service object.
◆ myThingie()
| virtual void* Football::ServiceBase::myThingie |
( |
void |
| ) |
const |
|
inlinefinalprotectedvirtual |
◆ newConnectionFromFile()
| Connection * Football::ServiceBase::newConnectionFromFile |
( |
const std::string & |
filename | ) |
|
Create a new "connection" that reads from a file.
Replies to the connection are transparently disposed. An appropriate event is dispatched to the connection when created, but nothing is read from the file yet. The caller may adjust the context or privileges; reading is done by the Arena (service manager) poll routines.
- Parameters
-
| filename | The name of the file to read from. |
- Returns
- An initialized Football::Connection, or NULL on error.
◆ newLoopbackConnection()
| Connection * Football::ServiceBase::newLoopbackConnection |
( |
int * |
loopback | ) |
|
Create a new connection that loops back to the service.
Bidirectional communication is supported. Replies to the connection are transparently disposed. An appropriate event is dispatched to the connection when created, but nothing is read from the file yet. The caller may adjust the context or privileges; reading is done by the Arena (service manager) poll routines.
- Parameters
-
| loopback | On return, set to the socket used for loopback. |
- Returns
- A socket number, or -1 on error.
◆ serviceShutdown()
| void Football::ServiceBase::serviceShutdown |
( |
void |
| ) |
|
|
virtual |
Invoked when a service is shutting down.
Corresponds to FB_EVENT_STOPPED; by the time this is received, all connections have been closed.
Reimplemented in PianodService.
◆ Arena
◆ Connection
◆ Iterator
◆ service
Pointer to underlying Football service structure.
The documentation for this class was generated from the following files: