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

intermediate: introduce an abstract channel

This commit is contained in:
wellenvogel
2021-12-31 18:38:11 +01:00
parent 0acb988f31
commit 47fb805ee6
9 changed files with 351 additions and 259 deletions

View File

@@ -3,10 +3,11 @@
#include "GWConfig.h"
#include "GwLog.h"
#include "GwBuffer.h"
#include "GwChannelInterface.h"
#include <memory>
class GwSocketConnection;
class GwSocketServer{
class GwSocketServer: public GwChannelInterface{
private:
const GwConfigHandler *config;
GwLog *logger;
@@ -22,9 +23,9 @@ class GwSocketServer{
GwSocketServer(const GwConfigHandler *config,GwLog *logger,int minId);
~GwSocketServer();
void begin();
void loop(bool handleRead=true,bool handleWrite=true);
void sendToClients(const char *buf,int sourceId);
virtual void loop(bool handleRead=true,bool handleWrite=true);
virtual size_t sendToClients(const char *buf,int sourceId, bool partialWrite=false);
int numClients();
bool readMessages(GwMessageFetcher *writer);
virtual void readMessages(GwMessageFetcher *writer);
};
#endif