mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-05 06:01:32 +00:00
network: performance improvements across NAT stack
This commit is contained in:
@ -25,9 +25,13 @@ pub struct ProxyUdpHandler {
|
||||
|
||||
#[async_trait]
|
||||
impl NatHandler for ProxyUdpHandler {
|
||||
async fn receive(&self, data: &[u8]) -> Result<()> {
|
||||
self.rx_sender.try_send(data.to_vec())?;
|
||||
Ok(())
|
||||
async fn receive(&self, data: &[u8]) -> Result<bool> {
|
||||
if self.rx_sender.is_closed() {
|
||||
Ok(true)
|
||||
} else {
|
||||
self.rx_sender.try_send(data.to_vec())?;
|
||||
Ok(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user