[IPA] fix compiler warnings
This commit is contained in:
parent
7faf5a725c
commit
27f9a6e828
|
@ -139,7 +139,7 @@ reply({From, Ref}, Reply) ->
|
|||
init() ->
|
||||
case ets:new(ipa_sockets, [named_table, set, public, {keypos, #ipa_socket.socket}]) of
|
||||
ipa_sockets ->
|
||||
{ok};
|
||||
ok;
|
||||
_ ->
|
||||
{error, ets_new_ipa_sockets}
|
||||
end.
|
||||
|
@ -169,19 +169,25 @@ loop(S, StreamMap) ->
|
|||
ok
|
||||
end.
|
||||
|
||||
process_ccm_msg(Socket, StreamID, ?IPAC_MSGT_PING, Opts) ->
|
||||
% Respond with PONG to PING
|
||||
process_ccm_msg(Socket, StreamID, ?IPAC_MSGT_PING, _) ->
|
||||
send(Socket, StreamID, <<?IPAC_MSGT_PONG>>);
|
||||
process_ccm_msg(Socket, StreamID, ?IPAC_MSGT_ID_ACK, Opts) ->
|
||||
% Simply respond to ID_ACK with ID_ACK
|
||||
process_ccm_msg(Socket, StreamID, ?IPAC_MSGT_ID_ACK, _) ->
|
||||
send(Socket, StreamID, <<?IPAC_MSGT_ID_ACK>>);
|
||||
% Default message handler for unknown messages
|
||||
process_ccm_msg(Socket, StreamID, MsgType, Opts) ->
|
||||
io:format("Unknown CCM message type ~p~n", [MsgType]).
|
||||
io:format("Socket ~p Stream ~p: Unknown CCM message type ~p Opts ~p~n",
|
||||
[Socket, StreamID, MsgType, Opts]).
|
||||
|
||||
% process an incoming CCM message (Stream ID 254)
|
||||
process_rx_ccm_msg(Socket, StreamID, PayloadBin) ->
|
||||
[MsgType|Opts] = binary:bin_to_list(PayloadBin),
|
||||
process_ccm_msg(Socket, StreamID, MsgType, Opts).
|
||||
|
||||
% convenience wrapper for interactive use / debugging from the shell
|
||||
listen_accept_handle(LPort, Opts) ->
|
||||
case gen_tcp:listen(LPort, Opts) of
|
||||
case gen_tcp:listen(LPort, [binary, {packet, 0}, {reuseaddr, true}] ++ Opts) of
|
||||
{ok, ListenSock} ->
|
||||
{ok, Port} = inet:port(ListenSock),
|
||||
{ok, Sock} = gen_tcp:accept(ListenSock),
|
||||
|
|
Reference in New Issue