#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);
|
};
|