drogon/examples/simple_example/WebSocketTest.cc

18 lines
585 B
C++
Raw Normal View History

2018-08-22 07:08:48 +00:00
#include "WebSocketTest.h"
using namespace example;
2018-10-14 07:56:54 +00:00
void WebSocketTest::handleNewMessage(const WebSocketConnectionPtr &wsConnPtr, std::string &&message)
2018-08-22 07:08:48 +00:00
{
//write your application logic here
2019-01-17 05:51:25 +00:00
LOG_DEBUG << "new websocket message:" << message;
2018-08-23 05:17:54 +00:00
}
void WebSocketTest::handleConnectionClosed(const WebSocketConnectionPtr &)
{
2019-01-17 05:51:25 +00:00
LOG_DEBUG << "websocket closed!";
}
void WebSocketTest::handleNewConnection(const HttpRequestPtr &,
2019-01-17 05:51:25 +00:00
const WebSocketConnectionPtr &conn)
{
2019-01-17 05:51:25 +00:00
LOG_DEBUG << "new websocket connection!";
conn->send("haha!!!");
2018-11-16 05:26:14 +00:00
}