Indy 10 接收数据丢失问题
对方发给我3组数据包,有时能全收到有时只收到 1~2组包,请教高手给指点下!
接收代码如下:
procedure TForm.IdCollectServerExecute(AContext: TIdContext);
var
Msg :TIdBytes;
Mtu :TMtuBase;
i : integer;
s :String;
begin
AContext.Connection.IOHandler.ReadBytes(Msg,-1);
for I := Low(Msg) to High(Msg) do
s :=s+' '+Format('%-.2x',[Msg[i]]);
WriteLog('收:'+s);
end;