reverting changes on server since 0.8.1
This commit is contained in:
parent
5ca1d2699f
commit
26a7d2489d
@ -68,14 +68,14 @@ impl Connection {
|
||||
};
|
||||
|
||||
let res = tokio::select! {
|
||||
res = tokio::spawn(Self::listen_uni_streams(conn.clone(), uni_streams)) => res,
|
||||
res = tokio::spawn(Self::listen_bi_streams(conn.clone(), bi_streams)) => res,
|
||||
res = tokio::spawn(Self::listen_datagrams(conn.clone(), datagrams)) => res,
|
||||
res = tokio::spawn(Self::listen_received_udp_packet(conn.clone(), recv_pkt_rx)) => res,
|
||||
Err(err) = Self::handle_authentication_timeout(conn, auth_timeout) => Ok(Err(err)),
|
||||
res = Self::listen_uni_streams(conn.clone(), uni_streams) => res,
|
||||
res = Self::listen_bi_streams(conn.clone(), bi_streams) => res,
|
||||
res = Self::listen_datagrams(conn.clone(), datagrams) => res,
|
||||
res = Self::listen_received_udp_packet(conn.clone(), recv_pkt_rx) => res,
|
||||
Err(err) = Self::handle_authentication_timeout(conn, auth_timeout) => Err(err),
|
||||
};
|
||||
|
||||
match res.unwrap() {
|
||||
match res {
|
||||
Ok(()) => unreachable!(),
|
||||
Err(err) => {
|
||||
is_closed.set_closed();
|
||||
|
@ -1,11 +1,11 @@
|
||||
use bytes::Bytes;
|
||||
use crossbeam_utils::atomic::AtomicCell;
|
||||
use parking_lot::Mutex;
|
||||
use socket2::{Domain, Protocol, SockAddr, Socket, Type};
|
||||
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
io::Result,
|
||||
net::{Ipv6Addr, SocketAddr, UdpSocket as StdUdpSocket},
|
||||
net::{Ipv4Addr, SocketAddr},
|
||||
sync::Arc,
|
||||
};
|
||||
use tokio::{
|
||||
@ -124,15 +124,7 @@ impl UdpSession {
|
||||
src_addr: SocketAddr,
|
||||
max_pkt_size: usize,
|
||||
) -> Result<Self> {
|
||||
let socket = Arc::new({
|
||||
let socket = Socket::new(Domain::IPV6, Type::DGRAM, Some(Protocol::UDP))?;
|
||||
socket.set_only_v6(false)?;
|
||||
socket.bind(&SockAddr::from(SocketAddr::from((
|
||||
Ipv6Addr::UNSPECIFIED,
|
||||
0,
|
||||
))))?;
|
||||
UdpSocket::from_std(StdUdpSocket::from(socket))?
|
||||
});
|
||||
let socket = Arc::new(UdpSocket::bind(SocketAddr::from((Ipv4Addr::UNSPECIFIED, 0))).await?);
|
||||
let (send_pkt_tx, send_pkt_rx) = mpsc::channel(1);
|
||||
|
||||
tokio::spawn(async move {
|
||||
|
Loading…
x
Reference in New Issue
Block a user