fix protocol

This commit is contained in:
anlicheng 2026-04-21 17:33:11 +08:00
parent 751b938e41
commit a566b99e98
2 changed files with 4 additions and 4 deletions

View File

@ -9,10 +9,10 @@
%%
%% REQUEST:
%% RESPONSE: REQUEST
%% REPLY: REQUEST
%% CAST:
-define(FRAME_REQUEST, 16#01).
-define(FRAME_RESPONSE, 16#02).
-define(FRAME_REPLY, 16#02).
-define(FRAME_CAST, 16#03).
%%%% ,

View File

@ -174,7 +174,7 @@ handle_info({ssl, Socket, <<?FRAME_CAST, FrameBin/binary>>},
CastFrame = message_pb:decode_msg(FrameBin, 'CastFrame'),
handle_cast_frame(CastFrame, HostPid, State);
handle_info({ssl, Socket, <<?FRAME_RESPONSE, FrameBin/binary>>},
handle_info({ssl, Socket, <<?FRAME_REPLY, FrameBin/binary>>},
State = #state{socket = Socket, inflight = Inflight}) ->
ReplyFrame = message_pb:decode_msg(FrameBin, 'ReplyFrame'),
handle_reply_frame(ReplyFrame, Inflight, State);
@ -317,4 +317,4 @@ handle_reply_frame(#'ReplyFrame'{packet_id = PacketId, reply = Reply}, _Inflight
-spec send_reply_frame(module(), any(), non_neg_integer(), tuple()) -> any().
send_reply_frame(Transport, Socket, PacketId, Reply) ->
Encoded = message_pb:encode_msg(#'ReplyFrame'{packet_id = PacketId, reply = Reply}),
Transport:send(Socket, <<?FRAME_RESPONSE, Encoded/binary>>).
Transport:send(Socket, <<?FRAME_REPLY, Encoded/binary>>).