make sure we flush even if no new data needs writing
@@ -390,8 +390,11 @@ FNET_Connection::Write(bool direct)
++my_write_work;
}
- while ((res > 0) && !broken) { // flush output pipeline
+ if ((res >= 0) && !broken) { // flush output pipeline
res = _socket->flush();
+ while (res > 0) {
+ res = _socket->flush();
+ }
}
if (writtenData > 0) {
