nt9856x/code/application/sifarsdk/component/HttpBase/include/HttpBase.h

21 lines
515 B
C++

#ifndef HTTP_BASE_H
#define HTTP_BASE_H
#include "SfTypeDefine.h"
#include <iostream>
constexpr int HTTP_PORT = 80;
constexpr int INVALID_SOCKET_FD = -1;
class HttpBase
{
public:
HttpBase(const std::string &hostName);
virtual ~HttpBase() = default;
SINT32 Create(void);
SINT32 Send(const char *data, const int &length);
SINT32 Rece(char *data, const int &length);
SINT32 Close(void);
private:
int mSocketFd;
const std::string mHostName;
};
#endif // !HTTP_BASE_H