为什么下边的收不到呢
发送
procedure TForm2.Button1Click(Sender: TObject);
var
Stream:TMemoryStream;
begin
Stream:=TMemoryStream.Create;
try
Stream.Write('abc',3);
IdTCPClient1.WriteStream(Stream,True,True);
finally
Stream.Free;
end;
end;
接收:
procedure TForm1.IdTCPServer1Execute(AThread: TIdPeerThread);
var
Stream:TMemoryStream;
Str:array[0..99]of char;
begin
Stream:=TMemoryStream.Create;
AThread.Connection.ReadStream(Stream,-1,False);
Stream.Seek(0,soFromBeginning);
ServerNote.Lines.LoadFromStream(Stream);
Stream.Read(Str,SizeOf(Str));
ServerNote.Lines.Add(str);
end;