This repository has been archived on 2021-11-25. You can view files and clone it, but cannot push or open issues/pull-requests.
JZFamily-HelloWorld/CWeatherDataSpider.h

39 lines
620 B
C++

//------------------------------------
//author: jidzh
//data; 2017-10-30
//------------------------------------
#pragma once
#include <string>
#include <WinSock2.h>
#ifdef DEBUG
#else
#endif // DEBUG
class CWeatherDataSpider
{
public:
CWeatherDataSpider();
~CWeatherDataSpider();
public:
bool GetWeatherDataXml();
void CloseConnect();
void ErrHandle(const std::wstring msg, int code =0);
public:
std::string m_strAreaCode;
private:
SOCKET m_socket;
//WSADATA m_WSAdata;
bool CheckIfRecSucceed(char * buf, int nTotalRecv, int nFlag);
bool ConnectHost();
bool SendReq();
bool HandleAck();
};