mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
net: convert standalone SetSocketNonBlocking() to Sock::SetNonBlocking()
This further encapsulates syscalls inside the `Sock` class. Co-authored-by: practicalswift <practicalswift@users.noreply.github.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user