[wpinet] Wrap a number of newer libuv features (#4260)

This commit is contained in:
Peter Johnson
2022-05-22 20:18:23 -07:00
committed by GitHub
parent 816aa4e465
commit 013efdde25
7 changed files with 97 additions and 0 deletions

View File

@@ -167,4 +167,15 @@ void Tcp::Connect6(std::string_view ip, unsigned int port,
}
}
void Tcp::CloseReset() {
if (!IsClosing()) {
uv_tcp_close_reset(GetRaw(), [](uv_handle_t* handle) {
Tcp& h = *static_cast<Tcp*>(handle->data);
h.closed();
h.Release(); // free ourselves
});
ForceClosed();
}
}
} // namespace wpi::uv