Delphi TClientSocket(仍然)是否已弃用?

发布于 2024-10-09 17:32:17 字数 760 浏览 0 评论 0原文

在错误报告的解决评论12266(“套接字连接错误导致资源泄漏”),Robert Ehteshamzadeh 写道

TClientSocket 已弃用。这 报告保持开放状态以允许 建议的解决方法。

这是针对 Delphi 6 的。在更高版本中,TClientSocket 和 TServerSocket 默认情况下未安装在工具选项板中,但安装说明为 提供

从那时起,这个状态是否发生了变化,使得 TClientSocket(以及 TServerSocket)现在再次成为 Delphi VCL 中的一流成员?我想在某些项目中使用 TClientSocket(作为 Indy 和 Synapse 之后的另一个 TCP/IP 库),但在 Embarcadero DocWiki

(“已弃用”类/方法的官方索引将很有用)。

In the resolution comments for bug report 12266 ("Error on socket connect causes resource leak"), Robert Ehteshamzadeh wrote

TClientSocket is deprecated. This
report is left open to allow for
suggested workarounds.

This was for Delphi 6. In later versions, TClientSocket and TServerSocket have not been installed in the Tool palette by default, but an installation instruction was provided.

Has this status changed since then, so that TClientSocket (and TServerSocket too) are now first-class members in the Delphi VCL again? I would like to use TClientSocket (as another TCP/IP library after Indy and Synapse) in some projects and could not find an official status information in the Embarcadero DocWiki.

(An official index of 'deprecated' classes / methods would be useful).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

萌化 2024-10-16 17:32:17

具体回答你的问题:

是的,TClientSocket和TServerSocket仍然被弃用,我无法想象这种情况会改变。

To answer your question specifically:

Yes, TClientSocket and TServerSocket are still deprecated, and I can't imagine that this situation will change.

污味仙女 2024-10-16 17:32:17

TClientSocket和TServerSocket使用基于Windows消息的无效设计。这个方案是在 Windows 3.11 中引入的(或者它发生在 3.1 中?),当时没有真正的多任务处理,多线程套接字处理是不可能的。由于组件市场上出现了更强大和高性能的解决方案(即 Indy,然后是其他库),因此弃用了。尽管组件仍在运输中,但让旧技术重新焕发活力是没有意义的。此外,我建议 Embarcadero 包含一些基于 IOCP 的服务器套接字实现,但是,我猜服务器套接字现在不在 Embarcadero 的兴趣范围内。

TClientSocket and TServerSocket use ineffective design based on Windows messages. This scheme was introduced in Windows 3.11 (or did it happen in 3.1?), when there was no true multitasking and multithreaded socket handling was impossible. Deprecation took place due to more powerful and high-performing solutions appeared on the component market (namely Indy, then other libraries). There's no sense to bring the old technology back to life though the components are still shipped. Moreover, I'd suggest Embarcadero to include some IOCP-based server socket implementation to be included, however, I guess server sockets are not in the scope of interest for Embarcadero now.

那些过往 2024-10-16 17:32:17

嗯,这取决于您所说的已弃用的内容。 如果“不再包含在任何源文件夹中”算作已弃用,那么是的,它仍然已弃用(D2009)。

更新

TClientSocket 和 TServerSocket 的源是实际上存在。 @mjn 和@Eugene 向我指出了这一点。只是再次表明,使用 Windows 搜索没有找到某些内容并不意味着它不存在。它可能只是潜伏在 Windows 认为“不可搜索”扩展名的文件中,因为尚未为其定义搜索过滤器...(以为我已经为 .pas 文件设置了它,但事实证明这是在我的另一台机器上)。

但我想这并不会影响它仍然被弃用......

Well, it depends on what you call deprecated. If "no longer included in any of the source folders" counts as being deprecated, then yes, it is still deprecated (D2009).

Update

The source for TClientSocket and TServerSocket is actually present. @mjn and @Eugene pointed me towards it. Just goes to show once again that not finding something with Windows search doesn't mean it isn't there. It may just lurk in a file with an extension that Windows considers "un-search-able" because a search filter has not been defined for it... (Thought I had it set up for .pas files, but turns out that was on another of my machines).

But I guess that doesn't detract from it still being deprecated...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文