delphi中indy10 的Idtcpserver断开客户端连接报错问题的解决办法


本文整理自网络,侵删。

 我们常用IdTCPServer1.Active := false;来关闭Idtcpserver,但这样会出卡机,并且操作也不会成功,后来,我改为这样:

var
  i: integer;
  AList: TList;
begin
  AList := IdTCPServer1.Contexts.LockList;
  try
    for i := AList.Count - 1 downto 0 do
    begin
      TIdContext(AList.Items[i]).Connection.Disconnect;
    end;
  finally
    IdTCPServer1.Contexts.UnlockList;
  end;

也就是说不要用IdTCPServer1.Active := false;这种方式来断开Idtcpserver。

相关阅读 >>

Delphi获取android上的imei

Delphi 隐藏进程的单元 unit hideprocess.pas

Delphi 把修改好的cookies重新赋值给webbrowser1 doc

Delphi 设置系统默认打印机

Delphi tanimate组件

Delphi比较两个位图是否相同

Delphi 关闭自己,重新运行

Delphi的goto语句

Delphi tms web core messagedlg对话框 yes no

Delphi怎么实现一定范围内的随机数呢?

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...