Driver, Gateway: Remove tokio 0.2 support (#118)
* Remove tokio 0.2 compat * Remove tokio 0.2 test * Remove tokio 0.2 CI
This commit is contained in:
@@ -22,10 +22,7 @@ use discortp::{
|
||||
};
|
||||
use flume::Receiver;
|
||||
use std::{collections::HashMap, sync::Arc};
|
||||
#[cfg(not(feature = "tokio-02-marker"))]
|
||||
use tokio::{net::UdpSocket, select};
|
||||
#[cfg(feature = "tokio-02-marker")]
|
||||
use tokio_compat::{net::udp::RecvHalf, select};
|
||||
use tracing::{error, instrument, trace, warn};
|
||||
use xsalsa20poly1305::XSalsa20Poly1305 as Cipher;
|
||||
|
||||
@@ -241,10 +238,7 @@ struct UdpRx {
|
||||
packet_buffer: [u8; VOICE_PACKET_MAX],
|
||||
rx: Receiver<UdpRxMessage>,
|
||||
|
||||
#[cfg(not(feature = "tokio-02-marker"))]
|
||||
udp_socket: Arc<UdpSocket>,
|
||||
#[cfg(feature = "tokio-02-marker")]
|
||||
udp_socket: RecvHalf,
|
||||
}
|
||||
|
||||
impl UdpRx {
|
||||
@@ -396,7 +390,6 @@ impl UdpRx {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "tokio-02-marker"))]
|
||||
#[instrument(skip(interconnect, rx, cipher))]
|
||||
pub(crate) async fn runner(
|
||||
mut interconnect: Interconnect,
|
||||
@@ -421,31 +414,6 @@ pub(crate) async fn runner(
|
||||
trace!("UDP receive handle stopped.");
|
||||
}
|
||||
|
||||
#[cfg(feature = "tokio-02-marker")]
|
||||
#[instrument(skip(interconnect, rx, cipher))]
|
||||
pub(crate) async fn runner(
|
||||
mut interconnect: Interconnect,
|
||||
rx: Receiver<UdpRxMessage>,
|
||||
cipher: Cipher,
|
||||
config: Config,
|
||||
udp_socket: RecvHalf,
|
||||
) {
|
||||
trace!("UDP receive handle started.");
|
||||
|
||||
let mut state = UdpRx {
|
||||
cipher,
|
||||
decoder_map: Default::default(),
|
||||
config,
|
||||
packet_buffer: [0u8; VOICE_PACKET_MAX],
|
||||
rx,
|
||||
udp_socket,
|
||||
};
|
||||
|
||||
state.run(&mut interconnect).await;
|
||||
|
||||
trace!("UDP receive handle stopped.");
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn rtp_valid(packet: RtpPacket<'_>) -> bool {
|
||||
packet.get_version() == RTP_VERSION && packet.get_payload_type() == RTP_PROFILE_TYPE
|
||||
|
||||
Reference in New Issue
Block a user