16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 01:19:18 +02:00
This commit is contained in:
milek7
2018-12-09 19:03:02 +01:00
parent f525a77e23
commit 35af6d48d6
6 changed files with 86 additions and 35 deletions

View File

@@ -10,12 +10,14 @@ namespace network
class connection : public std::enable_shared_from_this<connection>
{
private:
void message_received(message msg);
void message_received(message &msg);
void send_message(message &msg);
protected:
virtual void disconnect() = 0;
virtual void send_data(uint8_t *buffer, size_t len) = 0;
void data_received(uint8_t *buffer, size_t len);
virtual void send_data(std::shared_ptr<std::string> buffer) = 0;
void data_received(std::string &buffer);
public:
virtual void connected();
@@ -26,4 +28,10 @@ namespace network
protected:
std::vector<std::shared_ptr<connection>> clients;
};
class client
{
protected:
std::shared_ptr<connection> srv;
};
}