fix
This commit is contained in:
parent
eb3c9eb19d
commit
f947453e59
@ -69,12 +69,9 @@ init([ParentPid]) ->
|
|||||||
{active, true},
|
{active, true},
|
||||||
{verify, verify_none}
|
{verify, verify_none}
|
||||||
],
|
],
|
||||||
case ssl:connect(Host, Port, SslOptions, 5000) of
|
{ok, Socket} = ssl:connect(Host, Port, SslOptions, 5000),
|
||||||
{ok, Socket} ->
|
|
||||||
{ok, #state{parent_pid = ParentPid, host = Host, port = Port, socket = Socket}};
|
{ok, #state{parent_pid = ParentPid, host = Host, port = Port, socket = Socket}}.
|
||||||
{error, Reason} ->
|
|
||||||
{stop, Reason}
|
|
||||||
end.
|
|
||||||
|
|
||||||
%% @private
|
%% @private
|
||||||
%% @doc Handling call messages
|
%% @doc Handling call messages
|
||||||
@ -145,12 +142,10 @@ handle_info({ssl, Socket, <<?PACKET_PUBLISH, PacketId:32, Msg/binary>>}, State =
|
|||||||
{noreply, State#state{}};
|
{noreply, State#state{}};
|
||||||
|
|
||||||
handle_info({ssl_error, Socket, Reason}, State = #state{socket = Socket}) ->
|
handle_info({ssl_error, Socket, Reason}, State = #state{socket = Socket}) ->
|
||||||
lager:warning("[efka_agent] socket close with reason: ~p", [Reason]),
|
{stop, Reason, State};
|
||||||
{stop, transport_error, State};
|
|
||||||
|
|
||||||
handle_info({ssl_closed, Socket}, State = #state{socket = Socket}) ->
|
handle_info({ssl_closed, Socket}, State = #state{socket = Socket}) ->
|
||||||
lager:warning("[efka_agent] socket closed"),
|
{stop, ssl_closed, State};
|
||||||
{stop, transport_closed, State};
|
|
||||||
|
|
||||||
handle_info(_Info, State = #state{}) ->
|
handle_info(_Info, State = #state{}) ->
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user