idtcpserver和idtcpclient收发数据

idtcpserver发idtcpclient收发数据

//服务端
AContext.Connection.IOHandler.ReadStream(stream); AContext.Connection.IOHandler.Write(stream2, stream2.Size, True); //客户端 function Tfrmdm.GetServerTime: TDateTime; begin
// connect server if not IdTCPClient1.Connected then IdTCPClient1.Connect; IdTCPClient1.IOHandler.Write(FSendStream, FSendStream.Size, true); // recv server's data IdTCPClient1.IOHandler.ReadStream(FRecvStream); IdTCPClient1.Disconnect; end;

 

posted @ 2022-11-16 09:12  delphi中间件  阅读(455)  评论(0编辑  收藏  举报