1

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

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
mjn
  • 36,362
  • 28
  • 176
  • 378
  • What's wrong with Indy and Synapse? – Harriv Dec 28 '10 at 14:11
  • Indy and Synapse are already supported as 'pluggable' communication adapters in the libraries I wrote. Maybe if TClientSocket is no longer deprecated and has no obvious bugs/problems, I will add support for them too, only to give more choices. – mjn Dec 28 '10 at 14:24

3 Answers3

6

To answer your question specifically:

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

Nick Hodges
  • 16,902
  • 11
  • 68
  • 130
5

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.

Eugene Mayevski 'Callback
  • 45,135
  • 8
  • 71
  • 121
1

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

Kenneth Cochran
  • 11,954
  • 3
  • 52
  • 117
Marjan Venema
  • 19,136
  • 6
  • 65
  • 79
  • This is strange - for Delphi 2009, I have found `TClientSocket = class(TCustomSocket)` and `TServerSocket = class(TCustomServerSocket)` in C:\Program Files\CodeGear\RAD Studio\6.0\source\Win32\vcl\ScktComp.pas – mjn Dec 28 '10 at 09:46
  • In Delphi 2010 the source is available as well as in Delphi 2009. – Eugene Mayevski 'Callback Dec 28 '10 at 09:56
  • @mjn, @Eugene: You are quite right. When you pointed me to it, I found the source unit just fine. Turns out I had not registered any search filter for pas files on this machine. – Marjan Venema Dec 28 '10 at 11:20
  • 2
    Wouldn't it be wonderful if Delphi's install would set the .pas and .dfm to be searchable by windows? QC85632. – Ken Bourassa Dec 28 '10 at 21:08