#pragma once #include #include #include #include #include #include "FaceAuthResult.h" #define MAX_CMD_SIZE 1024 class CNetSocket { public: CNetSocket(); ~CNetSocket(); int PostForm(char * RemoteHostIP, int RemoteHostPort, char * lpURL, string formData, CFaceAuthResult &ret); int FindContentLength(string header); size_t RecvHttpHeader(int socket, string& header); int RecvHttpHeaderLength(int socket, string& length); int RecvHttpBody(int socket, string& body, int contentLen); int PostJson(char * RemoteHostIP, int RemoteHostPort, char * lpURL, string jsonData, string &strBody); int sendCmd(char * RemoteHostIP, int RemoteHostPort, char cmd[], string& header); int sendCmds(char * RemoteHostIP, int RemoteHostPort, char cmdInit[], char cmdGetStatus[],string &data); int RecvData(SOCKET socket, string& header); int recvPacketSize(SOCKET s); };