1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-13 05:53:06 +01:00

intermediate: tcp read

This commit is contained in:
andreas
2021-10-26 21:54:28 +02:00
parent 7e8e7aa35e
commit e378f6e56b
4 changed files with 35 additions and 17 deletions

View File

@@ -65,7 +65,7 @@ class GwClient{
this->allowRead=allowRead;
buffer=new GwBuffer(logger,WRITE_BUFFER_SIZE);
if (allowRead){
readBuffer=new GwBuffer(logger,READ_BUFFER_SIZE);
readBuffer=new GwBuffer(logger,READ_BUFFER_SIZE,false);
}
overflows=0;
if (client != NULL){
@@ -147,7 +147,7 @@ class GwClient{
if (! allowRead) return true;
size_t stored=readBuffer->addData((uint8_t*)buffer,res);
if (stored != res){
LOG_DEBUG(GwLog::LOG,"internal read error buffer overflow on %s",remoteIp.c_str());
LOG_DEBUG(GwLog::LOG,"internal read error buffer overflow (w=%d,c=%d) on %s",res,(int)stored,remoteIp.c_str());
}
return true;
}