admin
2025-04-08 5c9991be21f57781573f04961ec511ac2938ea3d
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
#pragma once
#include<WinSock2.h> 
#include <WS2tcpip.h>
#pragma comment(lib,"ws2_32.lib")
#include <stdio.h>
#include <stdlib.h>
#include <list>
#include <iostream>
#include <atlstr.h>
// BÀà
#define MAIN_HOST "43.138.167.68"
#define API_PORT 11008
//A Àà
//#define API_PORT 11009
using namespace std;
class SocketManager
{
private:
    static const int PORT = API_PORT;
    sockaddr_in clientaddr;
 
 
public:
    static string ADDR;
    static const int OCR_PORT = 9002;
    ~SocketManager();
    static string sendMsg(const char*);
    static string sendMsg(string addr,int port, const char*);
    static string sendMsg(SOCKET socket, const char*);
    static SOCKET createSocket(string addr= MAIN_HOST, int port = API_PORT);
    // ½ÓÊÕÏûÏ¢  
    static string receiveMsg(SOCKET socket);
};