1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-16 07:23:07 +01:00

intermediate: reading on tcp

This commit is contained in:
andreas
2021-10-26 20:28:21 +02:00
parent 60eabb05ab
commit 933ea0d0aa
8 changed files with 187 additions and 44 deletions

View File

@@ -2,6 +2,7 @@
#define _GWSOCKETSERVER_H
#include "GWConfig.h"
#include "GwLog.h"
#include "GwBuffer.h"
#include <memory>
#include <WiFi.h>
@@ -14,13 +15,16 @@ class GwSocketServer{
GwLog *logger;
gwClientPtr *clients;
WiFiServer *server=NULL;
bool allowReceive;
int maxClients;
int minId;
public:
GwSocketServer(const GwConfigHandler *config,GwLog *logger);
GwSocketServer(const GwConfigHandler *config,GwLog *logger,int minId);
~GwSocketServer();
void begin();
void loop();
void sendToClients(const char *buf);
void sendToClients(const char *buf,int sourceId);
int numClients();
bool readMessages(GwBufferWriter *writer);
};
#endif