pub struct VoicePlane { /* private fields */ }Expand description
The UDP plane.
Implementations§
Source§impl VoicePlane
impl VoicePlane
pub fn new( socket: Arc<UdpSocket>, peers: Arc<Peers>, config: GatewayConfig, ) -> VoicePlane
Sourcepub async fn run(&self) -> Result<()>
pub async fn run(&self) -> Result<()>
Service datagrams until the socket errors. Runs for the life of the gateway.
§Errors
Only when the socket itself fails. One bad datagram never ends the plane.
Sourcepub fn handle_datagram(
&self,
datagram: &[u8],
from: SocketAddr,
) -> Vec<Datagram> ⓘ
pub fn handle_datagram( &self, datagram: &[u8], from: SocketAddr, ) -> Vec<Datagram> ⓘ
Process one datagram. All crypto is synchronous and happens here; the caller performs the awaited sends.
Every path ends in an explicit outcome (R6): datagrams to send, a queued tunnel message, or a logged drop.
Sourcepub fn route(
&self,
sender: &Arc<Peer>,
audio: &Audio,
now: Instant,
bytes: usize,
) -> Vec<Datagram> ⓘ
pub fn route( &self, sender: &Arc<Peer>, audio: &Audio, now: Instant, bytes: usize, ) -> Vec<Datagram> ⓘ
Route one voice packet from sender, whichever transport it arrived on.
Shared by the UDP plane and the TCP tunnel so both apply the same budget, the same target vocabulary and the same table.
bytes is the decoded packet as it arrived, billed to this connection’s
throughput window whichever transport carried it.
Auto Trait Implementations§
impl Freeze for VoicePlane
impl RefUnwindSafe for VoicePlane
impl Send for VoicePlane
impl Sync for VoicePlane
impl Unpin for VoicePlane
impl UnwindSafe for VoicePlane
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more