C++ Connection wrapper.
More...
#include <football.h>
|
| ServiceBase * | service (void) const |
| | Get a connection's parent service.
|
| |
| virtual ssize_t | conditional_print (bool(*callback)(FB_CONNECTION *), const std::string &message) override |
| | Send a message to some output queues depending on the callback function return value.
|
| |
| bool | transfer (ServiceBase *service, bool invokeNewConnectionHandler=false) |
| | Transfer a connection to another service.
|
| |
|
void | close (void) |
| | Initiate connection closure.
|
| |
| void | acceptInput (bool mode) |
| | Control acceptance of input.
|
| |
| virtual void | newConnection (const FB_EVENT *event) |
| | Invoked when a new connection has arrived/greeted.
|
| |
| virtual void | connectionClose (const FB_EVENT *event) |
| | Invoked when a connection is closing.
|
| |
| virtual void | inputReceived (const FB_EVENT *event) |
| | Invoked when a completed message is received.
|
| |
|
|
class | Iterator |
| |
|
class | ServiceBase |
| |
|
class | Arena |
| |
◆ acceptInput()
| void Football::Connection::acceptInput |
( |
bool |
mode | ) |
|
Control acceptance of input.
- Parameters
-
| mode | If true, enables input. If false, the connection is ignored; received input will be queued and received when input is again enabled. |
◆ conditional_print()
| ssize_t Football::Connection::conditional_print |
( |
bool(*)(FB_CONNECTION *) |
callback, |
|
|
const std::string & |
message |
|
) |
| |
|
overridevirtual |
Send a message to some output queues depending on the callback function return value.
- Parameters
-
| callback | A callback function accepting FB_CONNECTION * that returns true to broadcast to, false to skip. |
| message | The message to put on the output queue. |
Implements Football::Thingie.
◆ connectionClose()
| void Football::Connection::connectionClose |
( |
const FB_EVENT * |
event | ) |
|
|
virtual |
Invoked when a connection is closing.
Corresponds to FB_EVENT_CLOSE event. This is the last notification/event for a connection before it closes.
- Parameters
-
| event | Closing connection details. |
◆ inputReceived()
| void Football::Connection::inputReceived |
( |
const FB_EVENT * |
event | ) |
|
|
virtual |
Invoked when a completed message is received.
Corresponds to FB_EVENT_INPUT event.
- Parameters
-
| event | Details of the message received. |
◆ newConnection()
| void Football::Connection::newConnection |
( |
const FB_EVENT * |
event | ) |
|
|
virtual |
Invoked when a new connection has arrived/greeted.
Corresponds to FB_EVENT_CONNECT.
- Parameters
-
| event | The new connection details, or a nullptr for transferred connections. |
◆ service()
| ServiceBase * Football::Connection::service |
( |
void |
| ) |
const |
Get a connection's parent service.
- Returns
- The C++ service object for the connection.
◆ transfer()
| bool Football::Connection::transfer |
( |
ServiceBase * |
newservice, |
|
|
bool |
invokeNewConnectionHandler = false |
|
) |
| |
Transfer a connection to another service.
- Parameters
-
| newservice | The service to transfer to. |
| invokeNewConnectionHandler | If true, the newConnection handler is invoked with a nullptr. |
The documentation for this class was generated from the following files: