Trait shadowsocks_service::local::net::UdpInboundWrite
source · [−]pub trait UdpInboundWrite {
fn send_to<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
peer_addr: SocketAddr,
remote_addr: &'life1 Address,
data: &'life2 [u8]
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait;
}
Expand description
Writer for sending packets back to client
Currently it requires async-trait
for async fn
in trait, which will allocate a Box
ed Future
every call of send_to
.
This performance issue could be solved when generic_associated_types
and generic_associated_types
are stabilized.
Required methods
Sends packet data
received from remote_addr
back to peer_addr