Is Delphi TClientSocket (still) deprecated?

后端 未结 3 642
情书的邮戳
情书的邮戳 2021-01-24 01:30

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

TClientSocket is deprecate

相关标签:
3条回答
  • 2021-01-24 02:16

    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...

    0 讨论(0)
  • 2021-01-24 02:20

    To answer your question specifically:

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

    0 讨论(0)
  • 2021-01-24 02:29

    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.

    0 讨论(0)
提交回复
热议问题