1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31:
| Function GetInfo(VAR Info:TMemoryStream;ahost:STRING;aport:Integer):Boolean; Begin Result := false; Client.Host := ahost; Client.Port := aport; Try Client.Connect; Finally If Client.Connected then Begin Info.Seek(0, soFromBeginning); Try Client.OpenWriteBuffer; Client.WriteStream(Info,true,true); Client.CloseWriteBuffer; Except Client.CancelWriteBuffer; Client.Disconnect; Raise; End; End; If Client.Connected then Begin Info.Seek(0, soFromBeginning); Client.ReadStream(Info,-1,true); Client.Disconnect; End; End; Result:=true; End; |