forked from Mirrors/openclonk
Close connection if a packet can't be sent
I am still completely mystified why this seems to happen so often in practice. Hopefully the extra logging will give us some clues in future. And closing the connection immediately gives us a small chance at recovering from this situation.stable-5.3
parent
eabd15469f
commit
cd5c5fe30c
|
@ -1495,6 +1495,15 @@ bool C4Network2IOConnection::Send(const C4NetIOPacket &rPkt)
|
|||
bool fSuccess = pNetClass->Send(pLogEntry->Pkt);
|
||||
if (fSuccess)
|
||||
assert(!fPostMortemSent);
|
||||
else {
|
||||
// Not being able to send a packet is actually a big deal,
|
||||
// as this means that we will have hole in the packet
|
||||
// order. Better close the connection - post mortem should
|
||||
// ideally sort everything out from here.
|
||||
LogF("Network: Fatal: Send failed (%s)", pNetClass->GetError());
|
||||
pNetClass->ResetError();
|
||||
Close();
|
||||
}
|
||||
return fSuccess;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue