39 lines
620 B
C++
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();
|
|
};
|
|
|