| 2433 | } |
| 2434 | |
| 2435 | inline bool is_socket_alive(socket_t sock) { |
| 2436 | const auto val = detail::select_read(sock, 0, 0); |
| 2437 | if (val == 0) { |
| 2438 | return true; |
| 2439 | } else if (val < 0 && errno == EBADF) { |
| 2440 | return false; |
| 2441 | } |
| 2442 | char buf[1]; |
| 2443 | return detail::read_socket(sock, &buf[0], sizeof(buf), MSG_PEEK) > 0; |
| 2444 | } |
| 2445 | |
| 2446 | class SocketStream : public Stream { |
| 2447 | public: |
no test coverage detected