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:
23
lib/socketserver/GwSocketServer.h
Normal file
23
lib/socketserver/GwSocketServer.h
Normal 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
|
||||
Reference in New Issue
Block a user