diff --git a/apps/sdlan/src/sdlan_network.erl b/apps/sdlan/src/sdlan_network.erl index bcbf1d3..c2a0c70 100644 --- a/apps/sdlan/src/sdlan_network.erl +++ b/apps/sdlan/src/sdlan_network.erl @@ -39,8 +39,8 @@ -record(endpoint, { client_id :: binary(), ip :: integer(), - channel_pid :: undefined | pid(), - monitor_ref :: undefined | reference(), + channel_pid :: pid(), + monitor_ref :: reference(), hole :: undefined | #hole{}, %% 记录ip和ip_v6的映射关系, #{ip_addr :: integer() => {}} v6_info :: undefined | #sdl_v6_info{} @@ -401,7 +401,6 @@ handle_cast({update_hole, ClientId, Mac, Peer, NatType, V6Info}, State = #state{ mac = Mac, ip = Ip }), - broadcast(fun(#endpoint{channel_pid = ChannelPid}) -> case is_process_alive(ChannelPid) of true -> @@ -416,7 +415,7 @@ handle_cast({update_hole, ClientId, Mac, Peer, NatType, V6Info}, State = #state{ Endpoint = Endpoint0#endpoint{hole = #hole{peer = Peer, nat_type = NatType}, v6_info = V6Info}, {noreply, State#state{endpoints = maps:put(Mac, Endpoint, Endpoints)}}; - _ -> + error -> {noreply, State} end.