fix
This commit is contained in:
parent
2cc9bdadc1
commit
159586da72
@ -95,7 +95,6 @@ handle_cast(_Request, State) ->
|
||||
{noreply, NewState :: #state{}} |
|
||||
{noreply, NewState :: #state{}, timeout() | hibernate} |
|
||||
{stop, Reason :: term(), NewState :: #state{}}).
|
||||
|
||||
handle_info({udp, Sock, Ip, Port, <<?PACKET_STUN_REQUEST:8, Body/binary>>}, State = #state{socket = Sock}) ->
|
||||
StunRequest = catch sdlan_pb:decode_msg(Body, sdl_stun_request),
|
||||
%% 告知网络当前的ip对应的nat的映射关系
|
||||
@ -106,7 +105,11 @@ handle_info({udp, Sock, Ip, Port, <<?PACKET_STUN_REQUEST:8, Body/binary>>}, Stat
|
||||
StunReply = sdlan_pb:encode_msg(#sdl_stun_reply{
|
||||
cookie = Cookie
|
||||
}),
|
||||
ok = gen_udp:send(Sock, Ip, Port, <<?PACKET_STUN_REPLY, StunReply/binary>>),
|
||||
|
||||
|
||||
logger:debug("[sdlan_stun] xyz, reply size: ~p", [byte_size(StunReply)]),
|
||||
|
||||
ok = gen_udp:send(Sock, Ip, Port, <<?PACKET_STUN_REPLY:8, StunReply/binary>>),
|
||||
logger:debug("[sdlan_stun] stun_request network_id: ~p, client_id: ~p, hole: ~p, bytes: ~p", [NetworkId, ClientId, {Ip, Port}, byte_size(<<?PACKET_STUN_REPLY, StunReply/binary>>)])
|
||||
end,
|
||||
{noreply, State};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user