| 2502 | } |
| 2503 | |
| 2504 | inline bool is_socket_alive(socket_t sock) { |
| 2505 | const auto val = detail::select_read(sock, 0, 0); |
| 2506 | if (val == 0) { |
| 2507 | return true; |
| 2508 | } else if (val < 0 && errno == EBADF) { |
| 2509 | return false; |
| 2510 | } |
| 2511 | char buf[1]; |
| 2512 | return detail::read_socket(sock, &buf[0], sizeof(buf), MSG_PEEK) > 0; |
| 2513 | } |
| 2514 | |
| 2515 | class SocketStream : public Stream { |
| 2516 | public: |
no test coverage detected