#include <BaseOFConnection.hh>
Public Member Functions | |
virtual void | base_connection_callback (BaseOFConnection *conn, BaseOFConnection::Event event_type)=0 |
virtual void | base_message_callback (BaseOFConnection *conn, void *data, size_t len)=0 |
virtual void | free_data (void *data)=0 |
BaseOFHandler is an abstract class. Its methods must be implemented by classes that deal with BaseOFConnection events (usually classes that manage one or more BaseOFConnection objects).
|
pure virtual |
Callback for connection events.
This method blocks the event loop on which the connection is running, preventing other connection's events from being handled. If you want to perform a very long operation, try to queue it and return.
The implementation must be thread-safe, because it may be called by several EventLoop instances, each running in a thread.
conn | the BaseOFConnection on which the message was received |
event_type | the event type (see #BaseOFConnectionEvent) |
Implemented in fluid_base::OFServer, and fluid_base::BaseOFServer.
|
pure virtual |
Callback for new messages.
This method blocks the event loop on which the connection is running, preventing other connection's events from being handled. If you want to perform a very long operation, try to queue it and return.
The implementation must be thread-safe, because it may be called by several EventLoop instances, each running in a thread.
The message data will not be freed. To free it, you should call BaseOFConnection::free_data when you are done with it.
conn | the BaseOFConnection on which the message was received |
data | binary message data |
len | message length |
Implemented in fluid_base::OFServer, and fluid_base::BaseOFServer.
|
pure virtual |
Free the data passed to BaseOFHandler::base_message_callback.
Implemented in fluid_base::OFServer, and fluid_base::BaseOFServer.