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); ```