WsWebApp.hpp
Go to the documentation of this file.
1 // @formatter:off
2 //
3 // Balau core C++ library
4 //
5 // Copyright (C) 2017 Bora Software (contact@borasoftware.com)
6 //
7 // Licensed under the Boost Software License - Version 1.0 - August 17th, 2003.
8 // See the LICENSE file for the full license text.
9 //
10 
16 
17 #ifndef COM_BORA_SOFTWARE__BALAU_NETWORK_SERVER__WS_WEB_APPLICATION
18 #define COM_BORA_SOFTWARE__BALAU_NETWORK_SERVER__WS_WEB_APPLICATION
19 
21 
22 namespace Balau::Network::Http {
23 
24 class WsSession;
25 
36 class WsWebApp {
40  public: virtual void handleTextMessage(WsSession & session, std::string_view path) = 0;
41 
45  public: virtual void handleBinaryMessage(WsSession & session, std::string_view path) = 0;
46 
50  public: virtual void handleClose(WsSession & session, std::string_view path) = 0;
51 
55  public: virtual void handlePing(WsSession & session, std::string_view path) = 0;
56 
60  public: virtual void handlePong(WsSession & session, std::string_view path) = 0;
61 
63 
67  public: virtual ~WsWebApp() = default;
68 };
69 
70 } // namespace Balau::Network::Http
71 
72 #endif // COM_BORA_SOFTWARE__BALAU_NETWORK_SERVER__WS_WEB_APPLICATION
Components and utilities working on HTTP data transmission.
Definition: HttpClient.hpp:26
virtual void handleTextMessage(WsSession &session, std::string_view path)=0
Handle received text data.
Low level types used in networking code.
virtual void handlePong(WsSession &session, std::string_view path)=0
Handle a received pong control message.
Abstract base class of WebSocket web application handlers.
Definition: WsWebApp.hpp:36
virtual ~WsWebApp()=default
Destroy the WebSocket web application instance.
virtual void handleBinaryMessage(WsSession &session, std::string_view path)=0
Handle received binary data.
virtual void handleClose(WsSession &session, std::string_view path)=0
Handle a received close control message.
virtual void handlePing(WsSession &session, std::string_view path)=0
Handle a received ping control message.
Manages the handling of WebSocket messages in a WebSocket connection.
Definition: WsSession.hpp:35