-
Notifications
You must be signed in to change notification settings - Fork 0
/
WebSockHandler.cpp
47 lines (39 loc) · 1.14 KB
/
WebSockHandler.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "WebSockHandler.h"
WebSockHandler::WebSockHandler(const string& strBindIp/* = string("127.0.0.1")*/, short sPort/* = 9090*/) : WebSocket(strBindIp, sPort)
{
}
WebSockHandler::~WebSockHandler()
{
}
void WebSockHandler::Connected(const void* pId)
{
lock_guard<mutex> lock(m_mxSockets);
m_vSocket.push_back(pId);
}
void WebSockHandler::Closeing(const void* pId)
{
lock_guard<mutex> lock(m_mxSockets);
for (auto iter = m_vSocket.begin(); iter != m_vSocket.end(); ++iter)
{
if (*iter == pId)
{
m_vSocket.erase(iter);
break;
}
}
}
void WebSockHandler::TextDataRecieved(const void* pId, const wstring strPath, uint8_t* szData, uint32_t nDataLen)
{
//WriteData(pId, szData, nDataLen);
}
void WebSockHandler::BinaryDataRecieved(const void* pId, const wstring strPath, uint8_t* szData, uint32_t nDataLen, bool bLastPaket)
{
//OutputDebugString(wstring(L"Bytes received:" + to_wstring(nDataLen) + L"\r\n").c_str());
}
void WebSockHandler::PongRecieved(const void* pId)
{
#if defined(_WIN32) || defined(_WIN64)
//OutputDebugString(L"pong frame\r\n");
#endif
//SendPing(pId);
}