Indy10把参数由AThread换成AContext后,用法已经不同.

OnConnect中获取来源IP
AContext.Connection.Socket.Binding.PeerIP;

OnExecute中处理客户端来的数据
Var
aThread:TIdMappedPortContext;
s:
string;
begin
   aThread:
=TIdMappedPortContext(aContext);
   s:
=aThread.netdata;
  
//Indy10中IdMappedPortTCP的用法..(处理过程)

end;

OnOutboundData中处理服务端过来的数据
Var
 aThread:TIdMappedPortContext;
 s:
string;
begin
  aThread:
=TIdMappedPortContext(aContext);
  s:
=aThread.netdata;
  
//Indy10中IdMappedPortTCP的用法..
end;

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案