diff options
author | Vasil Dimov <vd@FreeBSD.org> | 2021-04-19 11:35:09 +0200 |
---|---|---|
committer | Vasil Dimov <vd@FreeBSD.org> | 2022-07-20 16:26:24 +0200 |
commit | b527b549504672704a61f70d2565b9489aaaba91 (patch) | |
tree | 8e303842e1ad9b220ba2d5f150061a2061887663 /src/netbase.cpp | |
parent | 29f66f76826056f53d971ac734b7ed49b39848d3 (diff) |
net: convert standalone SetSocketNonBlocking() to Sock::SetNonBlocking()
This further encapsulates syscalls inside the `Sock` class.
Co-authored-by: practicalswift <practicalswift@users.noreply.github.com>
Diffstat (limited to 'src/netbase.cpp')
-rw-r--r-- | src/netbase.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/netbase.cpp b/src/netbase.cpp index b13d6b1ae0..d504107d91 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -304,8 +304,7 @@ enum class IntrRecvError { * read. * * @see This function can be interrupted by calling InterruptSocks5(bool). - * Sockets can be made non-blocking with SetSocketNonBlocking(const - * SOCKET&). + * Sockets can be made non-blocking with Sock::SetNonBlocking(). */ static IntrRecvError InterruptibleRecv(uint8_t* data, size_t len, int timeout, const Sock& sock) { @@ -525,7 +524,7 @@ std::unique_ptr<Sock> CreateSockTCP(const CService& address_family) } // Set the non-blocking option on the socket. - if (!SetSocketNonBlocking(sock->Get())) { + if (!sock->SetNonBlocking()) { LogPrintf("Error setting socket to non-blocking: %s\n", NetworkErrorString(WSAGetLastError())); return nullptr; } |