公网端口默认设置为0
This commit is contained in:
+2
-3
@@ -78,7 +78,7 @@ impl Into<NatType> for PunchNatType {
|
|||||||
|
|
||||||
impl NatTest {
|
impl NatTest {
|
||||||
pub fn new(
|
pub fn new(
|
||||||
channel_num: usize,
|
_channel_num: usize,
|
||||||
mut stun_server: Vec<String>,
|
mut stun_server: Vec<String>,
|
||||||
local_ipv4: Option<Ipv4Addr>,
|
local_ipv4: Option<Ipv4Addr>,
|
||||||
ipv6: Option<Ipv6Addr>,
|
ipv6: Option<Ipv6Addr>,
|
||||||
@@ -87,8 +87,7 @@ impl NatTest {
|
|||||||
) -> NatTest {
|
) -> NatTest {
|
||||||
let server = stun_server[0].clone();
|
let server = stun_server[0].clone();
|
||||||
stun_server.resize(3, server);
|
stun_server.resize(3, server);
|
||||||
let mut ports = udp_ports.clone();
|
let ports = vec![0; udp_ports.len()];
|
||||||
ports.resize(channel_num, 0);
|
|
||||||
let nat_info = NatInfo::new(
|
let nat_info = NatInfo::new(
|
||||||
Vec::new(),
|
Vec::new(),
|
||||||
ports,
|
ports,
|
||||||
|
|||||||
Reference in New Issue
Block a user