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;
本文来自博客园,作者:{咏南中间件},转载请注明原文链接:https://www.cnblogs.com/hnxxcxg/p/16894756.html