21 lines
533 B
C++
21 lines
533 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
|
|
|
|
class TcpNet {
|
|
|
|
public:
|
|
TcpNet();
|
|
|
|
// starts listening on port
|
|
int server(int port, std::function<std::pair<bool, std::string>(std::string)> process_request);
|
|
|
|
// writes content to server on address:port and returns response
|
|
std::string client(const std::string address, int port, const std::string &content);
|
|
|
|
// TODO add support for vector of strings to be sent to server
|
|
// std::vector<std::string> client(const std::string address, int port, const std::vector<std::string> &content);
|
|
|
|
};
|