feature: Add keyboard record feature

This commit is contained in:
yuanyuanxiang
2025-01-31 22:22:16 +08:00
parent ac2d54a706
commit 0d6d171909
23 changed files with 1048 additions and 3 deletions

View File

@@ -3,6 +3,7 @@
#include "2015Remote.h"
#include <iostream>
#include <ws2tcpip.h>
#if USING_ZLIB
#include "zlib.h"
@@ -43,6 +44,23 @@ CRITICAL_SECTION IOCPServer::m_cs = {0};
#define SAFE_DELETE(p) if(p){ delete (p); (p) = NULL; }
// <20><><EFBFBD><EFBFBD> socket <20><>ȡ<EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD>IP<49><50>ַ.
std::string GetRemoteIP(SOCKET sock) {
sockaddr_in addr;
int addrLen = sizeof(addr);
if (getpeername(sock, (sockaddr*)&addr, &addrLen) == 0) {
char ipStr[INET_ADDRSTRLEN];
inet_ntop(AF_INET, &addr.sin_addr, ipStr, sizeof(ipStr));
TRACE(">>> <20>Զ<EFBFBD> IP <20><>ַ: %s\n", ipStr);
return ipStr;
}
TRACE(">>> <20><>ȡ<EFBFBD>Զ<EFBFBD> IP ʧ<><CAA7>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: %d\n", WSAGetLastError());
char buf[10];
sprintf_s(buf, "%d", sock);
return buf;
}
IOCPServer::IOCPServer(void)
{
WSADATA wsaData;