feat(echo): add echo client and server with CLI support
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
#include "aliases.hpp"
|
||||
#include "logger.hpp"
|
||||
#include <string>
|
||||
|
||||
class EchoClient final
|
||||
{
|
||||
public:
|
||||
EchoClient(IoContext &io, std::string host, unsigned short port);
|
||||
|
||||
bool run(const std::string &message);
|
||||
|
||||
private:
|
||||
bool connect();
|
||||
bool send(const std::string &message);
|
||||
void close();
|
||||
|
||||
private:
|
||||
IoContext &io_;
|
||||
std::string host_;
|
||||
unsigned short port_;
|
||||
TcpSocket socket_{io_};
|
||||
};
|
||||
Reference in New Issue
Block a user