| 225 | } |
| 226 | |
| 227 | bool NativeHttpServer::isSocketConnected(const asio::ip::tcp::socket& sock) const { |
| 228 | if (!sock.is_open()) { |
| 229 | return false; |
| 230 | } |
| 231 | |
| 232 | // Check socket status using getsockopt |
| 233 | int error = 0; |
| 234 | socklen_t len = sizeof(error); |
| 235 | int ret = getsockopt(sock.native_handle(), SOL_SOCKET, SO_ERROR, (char*)&error, &len); |
| 236 | |
| 237 | if (ret != 0 || error != 0) { |
| 238 | return false; |
| 239 | } |
| 240 | |
| 241 | return true; |
| 242 | } |
| 243 | |
| 244 | } // namespace fl |
| 245 |
nothing calls this directly
no test coverage detected