Added a few comments.

This commit is contained in:
Pedro Pinto committed 2021-01-08 10:36:24 -05:00
1 parent 76be885a60
commit d2ed70b6dd
2 files changed
+12

No files matched your search

@@ -2,6 +2,10 @@
namespace bts::spartan {
// UDP or TCP connection handle for a connection managed by a
// reactor. Connections are obtained via
// Reactor::register_connection(). A connection is initially inactive
// and must be activated via the connect() call.
class IReactorConnection {
public:
virtual ~IReactorConnection() {}
@@ -6,8 +6,16 @@ namespace bts::spartan {
class IReactorHandler {
public:
virtual ~IReactorHandler() {};
// Succesfull connection
virtual void on_connect() = 0;
// Disconnection after successfull connection or failure to connect
virtual void on_disconnect() = 0;
// Successfull read. Passed buffer will be dealocated once the call
// return. Callers should copy it or complete processing it before
// returning.
virtual void on_data(const std::string_view &buffer) = 0;
};