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

TCP server separated

This commit is contained in:
andreas
2021-10-17 21:55:34 +02:00
parent 920177fada
commit 0360044ef3
7 changed files with 152 additions and 70 deletions

View File

@@ -0,0 +1,23 @@
#ifndef _GWSOCKETSERVER_H
#define _GWSOCKETSERVER_H
#include "GWConfig.h"
#include "GwLog.h"
#include <list>
#include <memory>
#include <WiFi.h>
using wiFiClientPtr = std::shared_ptr<WiFiClient>;
class GwSocketServer{
private:
const GwConfigHandler *config;
GwLog *logger;
std::list<wiFiClientPtr> clients;
WiFiServer *server=NULL;
public:
GwSocketServer(const GwConfigHandler *config,GwLog *logger);
void begin();
void loop();
void sendToClients(const char *buf);
int numClients();
};
#endif