mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-21 13:39:18 +02:00
work
This commit is contained in:
@@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user