nat type
This commit is contained in:
parent
b3b9fcd243
commit
ccf74b5781
@ -316,7 +316,7 @@ async fn send_stun_request(eee: &Node) {
|
||||
client_id: eee.config.node_uuid.clone(),
|
||||
network_id: eee.network_id.load(Ordering::Relaxed),
|
||||
ip: eee.device_config.get_ip(),
|
||||
nat_type: 0,
|
||||
nat_type: eee.get_nat_type() as u32,
|
||||
};
|
||||
let msg = encode_to_udp_message(Some(req), PacketType::StunRequest as u8).unwrap();
|
||||
if let Err(e) = send_to_sock(
|
||||
|
||||
@ -140,6 +140,9 @@ pub struct Node {
|
||||
unsafe impl Sync for Node {}
|
||||
|
||||
impl Node {
|
||||
pub fn get_nat_type(&self) -> NatType {
|
||||
self.nat_type.lock().unwrap().clone()
|
||||
}
|
||||
pub async fn start(&self, token: String) {
|
||||
*self._token.lock().unwrap() = token;
|
||||
self.start_stop_sender.send(true).await;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user