cpp-console-game/eRPC/Client.hpp
ethanglide 0e3b79dc88 Improve socket connection style
Previously, a new socket was being opened and closed on every call. Now, there is one socket per client which is used continuously until the connection closes.
2024-07-09 15:04:47 -04:00

23 lines
380 B
C++

#ifndef ERPC_CLIENT_HPP
#define ERPC_CLIENT_HPP
#include <string>
#include <vector>
#include <netinet/in.h>
namespace eRPC
{
class Client
{
public:
Client(std::string host, int port);
~Client();
std::string call(std::string method, std::vector<std::string> params);
private:
int sockfd;
sockaddr_in serverAddress;
};
}
#endif // ERPC_CLIENT_HPP