Delphi 2009, Indy 10, TIdTCPServer.OnExecute, how to grab all the bytes in the InputBuffer

后端 未结 2 1186
借酒劲吻你
借酒劲吻你 2020-12-25 10:08

I am messing around with the Indy 10 supplied with Delphi 2009 and am having trouble with getting all the data from the IOHandler when OnExecute fires...

pro         


        
2条回答
  •  我在风中等你
    2020-12-25 10:43

    procedure TFormMain.IdTCPServerExecute(AContext: TIdContext); 
    var
      RxBufStr: UTF8String;
      RxBufSize: Integer;
    begin    
      if AContext.Connection.IOHandler.Readable then
      begin     
        AContext.Connection.IOHandler.ReadBytes(TBytes(RxBufStr),-1, False);
      end;
    end; 
    

提交回复
热议问题