| 134 | #endif |
| 135 | |
| 136 | bool Socket::WaitReadable(struct timeval* tv, bool restart) |
| 137 | { |
| 138 | for (;;) |
| 139 | { |
| 140 | int n = Socket_PollReadable(Handle(), tv); |
| 141 | if (n != SOCKET_ERROR_RETURN) |
| 142 | { |
| 143 | return n > 0; |
| 144 | } |
| 145 | else if (!IsInterruptedAndRestart(restart)) |
| 146 | { |
| 147 | CheckError(n, "WaitReadable"); |
| 148 | break; |
| 149 | } |
| 150 | } |
| 151 | return false; |
| 152 | } |
| 153 | |
| 154 | bool Socket::WaitWriteable(struct timeval* tv, bool restart) |
| 155 | { |