逻辑对齐
This commit is contained in:
parent
2c66394593
commit
8db7cb5b11
@ -126,7 +126,8 @@ handle_event(info, {timeout, _, create_transport}, ?STATE_DISCONNECTED, State =
|
||||
case connect_socket() of
|
||||
{ok, Socket} ->
|
||||
AuthPacket = auth_packet(PacketId),
|
||||
send_packet(Socket, AuthPacket),
|
||||
AuthRequestFrame = <<?FRAME_REQUEST, AuthPacket/binary>>,
|
||||
send_packet(Socket, AuthRequestFrame),
|
||||
{next_state, ?STATE_AUTH, State#state{socket = Socket, auth_packet_id = PacketId, next_packet_id = PacketId + 1},
|
||||
[{state_timeout, 5000, auth_timeout}]};
|
||||
{error, Reason} ->
|
||||
@ -225,7 +226,8 @@ handle_event(internal, {decoded_cast, #'CastFrame'{body = {command, #'Command'{c
|
||||
{keep_state, State};
|
||||
{1, _} ->
|
||||
AuthPacket = auth_packet(PacketId),
|
||||
send_packet(Socket, AuthPacket),
|
||||
AuthRequestFrame = <<?FRAME_REQUEST, AuthPacket/binary>>,
|
||||
send_packet(Socket, AuthRequestFrame),
|
||||
{next_state, ?STATE_AUTH, State#state{auth_packet_id = PacketId, next_packet_id = PacketId + 1},
|
||||
[{state_timeout, 5000, auth_timeout}]};
|
||||
{0, _} ->
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user