Refactored socket send method and message recieved method (#25)

* Enhanced sockets

* Removed unnecessary copy operations

* Enhanced sock session send method to recieve rref

* Enhanced on_read with rvalue reference

* Added string_view

* Added comments
This commit is contained in:
Ravidu Lashan
2019-10-14 18:26:34 +05:30
committed by GitHub
parent 56c3e3ee93
commit 9ec9c9575d
9 changed files with 102 additions and 41 deletions

View File

@@ -15,8 +15,19 @@ class socket_session;
class socket_session_handler
{
public:
/**
* Executes on initiation of a new connection
*/
virtual void on_connect(socket_session *session) = 0;
virtual void on_message(socket_session *session, const std::string &message) = 0;
/**
* Executes on recieval of new message
*/
virtual void on_message(socket_session *session, std::string &&message) = 0;
/**
* Executes on websocket connection close
*/
virtual void on_close(socket_session *session) = 0;
};
} // namespace sock