From 2fb779ef32824a3763cbd92d10adcc5540758230 Mon Sep 17 00:00:00 2001 From: lbl <49143209+lbl8603@users.noreply.github.com> Date: Mon, 13 Jan 2025 21:40:40 +0800 Subject: [PATCH 1/2] expose shutdown_event --- src/session.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/session.rs b/src/session.rs index a017c71..30aed62 100644 --- a/src/session.rs +++ b/src/session.rs @@ -101,6 +101,9 @@ impl Session { .read_event .get_or_init(|| UnsafeHandle(unsafe { wintun.WintunGetReadWaitEvent(self.inner.0) }))) } + pub fn get_shutdown_event(&self) -> Result, Error> { + Ok(self.shutdown_event.get_handle()) + } /// Blocks until a packet is available, returning the next packet in the receive queue once this happens. /// If the session is closed via [`Session::shutdown`] all threads currently blocking inside this function From d01d0d905b36a531fdaa899f600ccbaecd3b1965 Mon Sep 17 00:00:00 2001 From: ssrlive <30760636+ssrlive@users.noreply.github.com> Date: Mon, 13 Jan 2025 22:14:45 +0800 Subject: [PATCH 2/2] Update session.rs --- src/session.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/session.rs b/src/session.rs index 30aed62..66e83c4 100644 --- a/src/session.rs +++ b/src/session.rs @@ -101,8 +101,9 @@ impl Session { .read_event .get_or_init(|| UnsafeHandle(unsafe { wintun.WintunGetReadWaitEvent(self.inner.0) }))) } - pub fn get_shutdown_event(&self) -> Result, Error> { - Ok(self.shutdown_event.get_handle()) + + pub fn get_shutdown_event(&self) -> UnsafeHandle { + self.shutdown_event.get_handle() } /// Blocks until a packet is available, returning the next packet in the receive queue once this happens.