不用自己去取,使用idTCPServer等待idTCPClient传回来数据流!
procedureIdTCPServerExecute(
AThread: TIdPeerThread);
var
IPPos, i: Integer;
InfoStream: TMemoryStream; //接收到的流
RecString: TStringList;
TmpTcpClient: TIdTcpClient;
Comparser_Tmp: TComparser; //处理客户端定时发送各类信息的指令字符串
begin
with AThread.Connection do
begin
while connected do
begin
ReadStream(FDataStream, -1, True); //接收返回的流
if SizeOf(FDataStream) > 0 then
begin
FDataStream.Position := 0;
FDataStream.ReadBuffer(FInfoNo, SizeOf(FInfoNo));
end;
finally
Disconnect;
end;
end;
end;
这样就可以接受回来的流了!