1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-22 23:56:13 +01:00

write buffer

This commit is contained in:
Harald Barth 2024-08-09 15:02:11 +02:00
parent 8c3c5dfe33
commit c8c3697fa0

View File

@ -239,13 +239,14 @@ void EthernetInterface::loop2() {
DIAG(F("Ethernet outboundRing socket=%d error"), socketOut);
} else if (socketOut >= 0) {
int count=outboundRing->count();
if (Diag::ETHERNET) DIAG(F("Ethernet reply socket=%d, count=:%d"), socketOut,count);
{
char tmpbuf[count+1]; // one extra for '\0'
for(int i=0;i<count;i++) {
tmpbuf[i] = outboundRing->read();
}
tmpbuf[count]=0;
if (Diag::ETHERNET)
DIAG(F("Ethernet reply socket=%d, count=%d, buf:%e"), socketOut,count,tmpbuf);
clients[socketOut].write(tmpbuf,count);
}
// do trust write does its thing and not flush