using IPv6 on server outbound UDP sockets
This commit is contained in:
parent
16fc2d45f0
commit
75d51be659
@ -5,7 +5,7 @@ use parking_lot::Mutex;
|
|||||||
use std::{
|
use std::{
|
||||||
collections::HashMap,
|
collections::HashMap,
|
||||||
io::Result,
|
io::Result,
|
||||||
net::{Ipv4Addr, SocketAddr},
|
net::{Ipv6Addr, SocketAddr},
|
||||||
sync::Arc,
|
sync::Arc,
|
||||||
};
|
};
|
||||||
use tokio::{
|
use tokio::{
|
||||||
@ -124,7 +124,7 @@ impl UdpSession {
|
|||||||
src_addr: SocketAddr,
|
src_addr: SocketAddr,
|
||||||
max_pkt_size: usize,
|
max_pkt_size: usize,
|
||||||
) -> Result<Self> {
|
) -> Result<Self> {
|
||||||
let socket = Arc::new(UdpSocket::bind(SocketAddr::from((Ipv4Addr::UNSPECIFIED, 0))).await?);
|
let socket = Arc::new(UdpSocket::bind(SocketAddr::from((Ipv6Addr::UNSPECIFIED, 0))).await?);
|
||||||
let (send_pkt_tx, send_pkt_rx) = mpsc::channel(1);
|
let (send_pkt_tx, send_pkt_rx) = mpsc::channel(1);
|
||||||
|
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user