fix
This commit is contained in:
parent
d544c04709
commit
a0724db88c
@ -93,7 +93,7 @@ handle_event(info, {connect_reply, Reply}, ?STATE_CONNECTING, State = #state{tra
|
||||
{next_state, ?STATE_AUTH, State};
|
||||
{error, Reason} ->
|
||||
lager:debug("[efka_agent] connect failed, error: ~p, pid: ~p", [Reason, TransportPid]),
|
||||
% efka_transport:stop(TransportPid),
|
||||
efka_transport:stop(TransportPid),
|
||||
{next_state, ?STATE_DENIED, State}
|
||||
end;
|
||||
|
||||
|
||||
@ -38,6 +38,7 @@
|
||||
auth_request(Pid, Timeout) when is_pid(Pid), is_integer(Timeout) ->
|
||||
gen_server:cast(Pid, {auth_request, Timeout}).
|
||||
|
||||
-spec connect(Pid :: pid()) -> no_return().
|
||||
connect(Pid) when is_pid(Pid) ->
|
||||
gen_server:cast(Pid, connect).
|
||||
|
||||
@ -128,7 +129,7 @@ handle_cast({auth_request, Timeout}, State = #state{parent_pid = ParentPid, sock
|
||||
{noreply, State#state{packet_id = PacketId + 1}}
|
||||
after Timeout ->
|
||||
ParentPid ! {auth_reply, {error, timeout}},
|
||||
{stop, normal, State}
|
||||
{noreply, State#state{packet_id = PacketId + 1}}
|
||||
end;
|
||||
|
||||
handle_cast({send, Method, Packet}, State = #state{socket = Socket}) ->
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user