From 6785aa4cb56833131b69f4d2b44301908b1a1b4c Mon Sep 17 00:00:00 2001 From: Mathias Hall-Andersen Date: Wed, 28 Aug 2019 16:27:26 +0200 Subject: Join with worker threads on device drop --- src/types/udp.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/types/udp.rs') diff --git a/src/types/udp.rs b/src/types/udp.rs index 00e218f..4bf0a9c 100644 --- a/src/types/udp.rs +++ b/src/types/udp.rs @@ -21,7 +21,9 @@ pub trait Bind: Send + Sync { fn set_port(&self, port: u16) -> Result<(), Self::Error>; /// Returns the current port of the bind - fn get_port(&self) -> u16; - fn recv(&self, dst: &mut [u8]) -> Self::Endpoint; - fn send(&self, src: &[u8], dst: &Self::Endpoint); + fn get_port(&self) -> Option; + + fn recv(&self, buf: &mut [u8]) -> Result<(usize, Self::Endpoint), Self::Error>; + + fn send(&self, buf: &[u8], dst: &Self::Endpoint) -> Result<(), Self::Error>; } -- cgit v1.2.3-59-g8ed1b