#include <OFConnection.hh>
Public Member Functions | |
| virtual void | connection_callback (OFConnection *conn, OFConnection::Event event_type)=0 |
| virtual void | message_callback (OFConnection *conn, uint8_t type, void *data, size_t len)=0 |
| virtual void | free_data (void *data)=0 |
OFHandler is an abstract class. Its methods must be implemented by classes that deal with OFConnection events (usually classes that manage one or more OFConnection 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 will possibly be called from several threads (on which connection events are being created).
| conn | the OFConnection on which the message was received |
| event_type | the event type (see #Event) |
Implemented in fluid_base::OFServer.
|
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 will possibly be called from several threads (on which message events are being created).
By default, the message data will managed (freed) for you. If you want a zero-copy behavior, see OFServerSettings::keep_data_ownership.
| conn | the OFConnection on which the message was received |
| type | OpenFlow message type |
| data | binary message data |
| len | message length |
Implemented in fluid_base::OFServer.
|
pure virtual |
Free the data passed to OFHandler::message_callback.
Implemented in fluid_base::OFServer.