为什么小弟我用indy传送文件时,红色字部份永远不执行

为什么我用indy传送文件时,红色字部份永远不执行?
procedure TForm2.IdTCPServerExecute(AThread: TIdPeerThread);
var
  FileName, sCommand: string;
  FStream: TFileStream;
begin
  sCommand := AThread.Connection.ReadLn();
  FLogEntry := sCommand + ' 来自于主机 '
  + AThread.Connection.Socket.Binding.PeerIP;
  AThread.Synchronize(AddLogEntry);
  if AnsiStartsText('SEND ', sCommand) then
  begin
  FileName := EdtData.Text + RightStr(sCommand, Length(sCommand)-5);
  if FileExists(FileName) then
  DeleteFile(FileName);
  try
  FStream := TFileStream.Create(FileName, FmCreate);
  AThread.Connection.ReadStream(FStream, 2048, true);
AThread.Connection.WriteLn('200: 数据接收胜利!');
FLogEntry := '上传的文件已保存 ' + sCommand;
AThread.Synchronize(AddLogEntry);
  Finally
  FStream.Free;
  end;
  end
  else if SameText(sCommand, 'QUIT') then
  begin
  FCommand := 'QUIT';
  FLogEntry := '断开同主机 '
  + AThread.Connection.Socket.Binding.PeerIP
  + ' 的连接!';
  AThread.Synchronize(AddLogEntry);
  AThread.Connection.Disconnect;
  end
  else
  begin
  FCommand := 'ERROR';
  AThread.Connection.WriteLn('500: 无法识别的命令!');
  FLogEntry := '无法识别命令:' + sCommand;
  AThread.Synchronize(AddLogEntry);
  end;//endif
end;

------解决方案--------------------
是不是代码停在AThread.Connection.ReadStream(FStream, 2048, true)这了,如果服务器不返回数据的话,客户端就会一直在这等待。
------解决方案--------------------
AThread.Connection.ReadStream(FStream, 2048, true); 

把 2048 改为 -1