Delphi(Indy)TIdTCPClient线程中 [英] Delphi (Indy) TIdTCPClient in thread

查看:318
本文介绍了Delphi(Indy)TIdTCPClient线程中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在互联网上,我看到将 TIdTCPClient放置在自定义TThread后代中似乎很常见……为什么这样做?

All around the internet I see it appears to be commonly done to place a "TIdTCPClient" inside a custom TThread descendent... why is this done?

有时我也看到服务器处于这样的线程中……为什么?

Sometimes I see the server in such a thread too...why?

干杯,
Adrian

Cheers, Adrian

推荐答案

Indy使用阻塞I / O,最好在线程中处理它,这是Indy总体设计的核心。阻止主UI线程会给用户留下一个印象,那就是应用程序实际上没有冻结。有关更多信息,请参见 Indy简介

Indy uses blocking I/O, which is best handled in threads, and this is core to Indy's overall design. Blocking the main UI thread gives users the impression that the app is frozen when it really isn't. Have a look at "Introduction to Indy" for more information.

这篇关于Delphi(Indy)TIdTCPClient线程中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆