From e1d6f74017d807c97c9801d7d0e91d14d30e73af Mon Sep 17 00:00:00 2001 From: an-tao Date: Sun, 25 Jul 2021 09:46:04 +0800 Subject: [PATCH] Websocket --- CHN-04-3-控制器-WebSocketController.md | 6 ++++-- ENG-04-3-Controller-WebSocketController.md | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHN-04-3-控制器-WebSocketController.md b/CHN-04-3-控制器-WebSocketController.md index d2fb6af..91be0c0 100644 --- a/CHN-04-3-控制器-WebSocketController.md +++ b/CHN-04-3-控制器-WebSocketController.md @@ -61,7 +61,8 @@ class EchoWebsock:public drogon::WebSocketController { public: virtual void handleNewMessage(const WebSocketConnectionPtr&, - std::string &&)override; + std::string &&, + const WebSocketMessageType &)override; virtual void handleNewConnection(const HttpRequestPtr &, const WebSocketConnectionPtr&)override; virtual void handleConnectionClosed(const WebSocketConnectionPtr&)override; @@ -100,7 +101,8 @@ void EchoWebsock::handleConnectionClosed(const WebSocketConnectionPtr &wsConnPtr ```c++ virtual void handleNewConnection(const HttpRequestPtr &req,const WebSocketConnectionPtr &wsConn); -virtual void handleNewMessage(const WebSocketConnectionPtr &wsConn,std::string &&message); +virtual void handleNewMessage(const WebSocketConnectionPtr &wsConn,std::string &&message, +const WebSocketMessageType &); virtual void handleConnectionClosed(const WebSocketConnectionPtr &wsConn); ``` diff --git a/ENG-04-3-Controller-WebSocketController.md b/ENG-04-3-Controller-WebSocketController.md index f480623..ec0b42d 100644 --- a/ENG-04-3-Controller-WebSocketController.md +++ b/ENG-04-3-Controller-WebSocketController.md @@ -63,7 +63,8 @@ class EchoWebsock:public drogon::WebSocketController { public: virtual void handleNewMessage(const WebSocketConnectionPtr&, - std::string &&)override; + std::string &&, + const WebSocketMessageType &)override; virtual void handleNewConnection(const HttpRequestPtr &, const WebSocketConnectionPtr&)override; virtual void handleConnectionClosed(const WebSocketConnectionPtr&)override; @@ -103,7 +104,8 @@ The user-defined websocket controller class inherits from the `drogon::WebSocket ```c++ virtual void handleNewConnection(const HttpRequestPtr &req,const WebSocketConnectionPtr &wsConn); -virtual void handleNewMessage(const WebSocketConnectionPtr &wsConn,std::string &&message); +virtual void handleNewMessage(const WebSocketConnectionPtr &wsConn,std::string &&message, +const WebSocketMessageType &); virtual void handleConnectionClosed(const WebSocketConnectionPtr &wsConn); ```