Web framework C++  2.0.0
Simple web framework on c++ designed to easily create web pages, etc
All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
network.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "socket_api.h"
4 #include "init_params.h"
5 
9 class Network {
10  std::string ip;
11  int port;
12  bool isIpv6;
13 protected:
15 public:
19  Network(const char * ip, int port, bool isIPv6);
20 
25  explicit Network(InitParams params);
26 
31  void setAPI(SocketAPI * api);
32 
37  bool init();
38 
43  std::string readData();
44 
45 
51  bool receiveData(const std::string & data);
52 
56  std::string toString();
57 
61  static std::string getIpFromDomain(std::string &domain, bool isHttps, bool *IPv6);
62 
66  static SocketAPI * createNewSocket();
67 };
static std::string getIpFromDomain(std::string &domain, bool isHttps, bool *IPv6)
bool init()
InitParams is intended to get web-server configs from command line arguments.
Definition: init_params.h:10
Network bridge pattern.
Definition: network.h:9
static SocketAPI * createNewSocket()
void setAPI(SocketAPI *api)
SocketAPI * socketImpl
Definition: network.h:14
std::string readData()
std::string toString()
Network(const char *ip, int port, bool isIPv6)
interface for network realization
Definition: socket_api.h:6
bool receiveData(const std::string &data)