MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / WouldBlock

Method WouldBlock

src/network/core/os_abstraction.cpp:40–49  ·  view source on GitHub ↗

* Check whether this error describes that the operation would block. * @return True iff the operation would block. */

Source from the content-addressed store, hash-verified

38 * @return True iff the operation would block.
39 */
40bool NetworkError::WouldBlock() const
41{
42#if defined(_WIN32)
43 return this->error == WSAEWOULDBLOCK;
44#else
45 /* Usually EWOULDBLOCK and EAGAIN are the same, but sometimes they are not
46 * and the POSIX.1 specification states that either should be checked. */
47 return this->error == EWOULDBLOCK || this->error == EAGAIN;
48#endif
49}
50
51/**
52 * Check whether this error describes a connection reset.

Callers 2

SendPacketsMethod · 0.80
ReceivePacketMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected