Indy 10 的 IdTCPServer 监听端口后,当客户端连接上后
直接关闭程序 IdTCPServer.Active := false; 时发现程序就僵死了。窗体关闭事件代码如下:
with IdCollectServer.Contexts.LockList do
try
for I :=Count - 1 downto 0 do
try
if TIdContext(Items[i]).Connection.Connected then
TIdContext(Items[i]).Connection.Disconnect;
except
end;
finally
IdCollectServer.Contexts.UnlockList;
end;
IdCollectServer.Active := false;
直接关闭程序 IdTCPServer.Active := false; 时发现程序就僵死了。窗体关闭事件代码如下:
with IdCollectServer.Contexts.LockList do
try
for I :=Count - 1 downto 0 do
try
if TIdContext(Items[i]).Connection.Connected then
TIdContext(Items[i]).Connection.Disconnect;
except
end;
finally
IdCollectServer.Contexts.UnlockList;
end;
IdCollectServer.Active := false;
2.indy10的代码不稳定,很难用。你最好还是不要用它。推荐用ICS
目前控件不可能替换了,继续寻求更多帮助!
indy10 还真是问题多多
那么下载indy9的稳定版本。
重新编译和安装indy的库
这样不需要替换控件 顶多会有一些好改的编译错误。
indy10确实很烂的 ,
我差点没让这个垃圾搞死。
我建议用短连接,也就是客户端在数据通讯时才与SERVER连接,数据传输完毕后,断掉。这样可容纳的客户端会更多。
呵呵,不过你的情况也许不一样。仅供参考。
下了 IndySnapshot 10 还是没有解决掉。。
这是Indy源码之问题,自己修正一下就行了
indy10 变化太大了。
自己看代码了!谢谢大家!