Add adapter_close to stop TCP stack

This commit is contained in:
Jackson Coxson
2025-10-22 10:26:13 -06:00
parent dd2db92967
commit 5ed2144d9e
4 changed files with 80 additions and 30 deletions

View File

@@ -53,6 +53,14 @@ class Adapter {
return Ok(ReadWrite::adopt(s));
}
Result<void, FfiError> close() {
FfiError e(::adapter_close(handle_.get()));
if (e) {
return Err(e);
}
return Ok();
}
private:
explicit Adapter(AdapterHandle* h) noexcept : handle_(h) {}
AdapterPtr handle_{};