This commit is contained in:
2020-08-28 17:49:58 +03:00
parent 234d4e73be
commit c5f70f4e09
6 changed files with 63 additions and 21 deletions

View File

@@ -26,8 +26,6 @@
#include "pip_cloud_export.h"
#include "piethernet.h"
class PIEthernet;
class PIP_CLOUD_EXPORT PICloudServer : public PIIODevice
{
@@ -37,6 +35,18 @@ public:
explicit PICloudServer(const PIString & path = PIString(), PIIODevice::DeviceMode mode = PIIODevice::ReadWrite);
virtual ~PICloudServer();
class Client : public PIIODevice {
PIIODEVICE(PICloudServer::Client)
public:
Client(PICloudServer * srv = nullptr);
protected:
bool openDevice();
private:
PICloudServer * server;
};
EVENT1(newConnection, PICloudServer::Client * , client)
protected:
bool openDevice();
bool closeDevice();
@@ -44,7 +54,11 @@ protected:
int writeDevice(const void * data, int max_size);
private:
EVENT_HANDLER2(void, readed, uchar * , data, int, size);
void sendStart();
PIEthernet eth;
PIVector<Client> clients;
};