net/SocketError: add syscall specific check functions

Fixes Windows compatibility.
This commit is contained in:
Max Kellermann
2021-01-21 22:04:14 +01:00
parent 2719f62feb
commit 9e2d09dabc
5 changed files with 76 additions and 9 deletions

View File

@@ -31,7 +31,7 @@ FullyBufferedSocket::DirectWrite(const void *data, size_t length) noexcept
const auto nbytes = GetSocket().Write((const char *)data, length);
if (gcc_unlikely(nbytes < 0)) {
const auto code = GetSocketError();
if (IsSocketErrorAgain(code))
if (IsSocketErrorSendWouldBlock(code))
return 0;
IdleMonitor::Cancel();