Click here to Skip to main content
12,251,445 members (65,709 online)
Click here to Skip to main content
Add your own
alternative version


25 bookmarked

Offset weaknesses of DCOM with strong points of socket

, 31 Mar 2002
Rate this:
Please Sign up or sign in to vote.
Combination of sockets and DCOM.


A few years ago when using DCOM to write simple distributed applications, I was fascinated with DCOM. However, I started to doubt this technology soon, and was gradually disappointed with it. Recently, I had time to work with sockets. After diagnosing DCOM net data communication with net tools, and comparing it with sockets, I found that DCOM kills efficiency of TCP/IP net data communication and DCOM net data communication is very inefficient. Here is the recommended article for you to read. Additionally, I also put two samples, socket development guide and speed test to let you test it. MS highly recommends us three-tier development and pushing all (or as many as possible) of logical operations into the middle tier. After reading these articles, you will understand the essence of this recommendation more deeply. The essence of this recommendation is to avoid bad DCOM net data traffic between a client and a server over Internet/intranet.

You maybe disagree with me, and say that my DCOM client-server application system works well to me. That is true only if a limited number of clients are connected to your DCOM server. That will be false if a large number of clients are involved. In this article, I will show you with a sample how to offset weaknesses of DCOM with sockets for improving your DCOM server application performance a lot.

Weaknesses of DCOM

What are the weaknesses of DCOM? Here is a list of them:

  • Net efficiency is very low.
  • DCOM calls are synchronous only, and can not be asynchronous. Connection points are faked asynchronous calls. This weakness complicates client side development in many cases. In order to solve slow calls problem, your DCOM clients will have to use threads to prevent client graphical user interfaces from being frozen. Threads will certainly hurt you if your application becomes large and complicated.
  • Your client applications never batch multiple calls into one. Lost of net data round-trips are involved.
  • Many others like slow initialization server object and security setup etc.

A perfect solution to DCOM with socket

What advantages does sockets have? If you read the above recommended articles, you will know the following advantages with sockets.

  • Net efficiency is better. If a batch of calls are involved, socket net efficiency is much better than DCOM.
  • Socket supports both synchronous and asynchronous calls. This feature definitely simplifies your client application development a lot. You will have much less chance to use worker threads to prevent client graphical user interfaces from being frozen.
  • Your client applications could easily batch multiple calls into one with less code or without any code. Net data round-trips are reduced.
  • Your client applications can run multiple socket connections to a server. Each of the connections run independently and in parallel without creating any worker threads. You can use different socket sessions to process different calls at the same time.

What disadvantages does sockets have? Here is the list of socket disadvantages:

  • It is difficult to program server side applications because of multiple threads problem.
  • You must handle socket security.

I already solved the above two socket problems for you. See the above articles. Attached with this example, you will find a socket-nized DCOM server with full C++ source code. Additionally you will see a VB client application with source code. It demonstrates the advantages of combination of sockets and DCOM. It uses strong points of DCOM to offset socket weakness (security) in Windows platforms, and also uses strong points of socket to offset weaknesses of DCOM too. No hacker is able to directly hack this application socket communication unless the hacker hacks Windows DCOM system first.


All of the applications included with this particular package are free with the following limitations:

  • A free/trial version of SocketPro server application only supports accepting 16 client connections only.
  • All of SocketPro client components are totally free to you. You can download the latest SocketPro with its documentation and samples here.
  • Authentication of both server applications, MultipleSvs.exe and MultiSvs.exe, are disabled for your easy setup and testing. You should pay enough attention to security. If not, someone may access your server machine files and manage them through the server application.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Yuancai (Charlie) Ye
Web Developer
United States United States
Yuancai (Charlie) Ye, an experienced software engineer, lives in Atlanta, Georgia. He is an expert at OLEDB consumer and created a powerful data accessing libarary at the site He has been working at SocketPro written from batching, asynchrony and parallel computation for more than three years. Visual C++, C# and ASP.NET are his favorite development environments.

You may also be interested in...

Comments and Discussions

General[Message Deleted] Pin
it.ragester2-Apr-09 21:51
memberit.ragester2-Apr-09 21:51 
Generaltool to convert DCOM interface to tcp/ip interface Pin
zabush27-Jun-04 10:35
memberzabush27-Jun-04 10:35 
GeneralRe: tool to convert DCOM interface to tcp/ip interface Pin
Annomous18-Oct-04 11:47
sussAnnomous18-Oct-04 11:47 
GeneralMy thoughts exactly! Pin
bsamwel8-Apr-02 5:27
memberbsamwel8-Apr-02 5:27 
GeneralSee these statements from Microsoft Pin
Yuancai (Charlie) Ye17-Apr-02 5:35
memberYuancai (Charlie) Ye17-Apr-02 5:35 
GeneralRe: See these statements from Microsoft Pin
Tim Smith17-Apr-02 5:46
memberTim Smith17-Apr-02 5:46 
GeneralRe: See these statements from Microsoft Pin
Yuancai (Charlie) Ye17-Apr-02 6:05
memberYuancai (Charlie) Ye17-Apr-02 6:05 
GeneralRe: See these statements from Microsoft Pin
Tim Smith17-Apr-02 6:09
memberTim Smith17-Apr-02 6:09 
GeneralRe: See these statements from Microsoft Pin
Yuancai (Charlie) Ye19-Apr-02 8:11
memberYuancai (Charlie) Ye19-Apr-02 8:11 
GeneralRe: See these statements from Microsoft Pin
Tim Smith19-Apr-02 8:59
memberTim Smith19-Apr-02 8:59 
GeneralRe: My thoughts exactly! Pin
Norm Almond17-Apr-02 6:19
memberNorm Almond17-Apr-02 6:19 
GeneralRe: My thoughts exactly! Pin
LJaxn21-Jan-04 1:58
memberLJaxn21-Jan-04 1:58 
GeneralCPropertySheet: Howto disable the cancel or abort button Pin
Rainer Mangold8-Apr-02 4:07
memberRainer Mangold8-Apr-02 4:07 
GeneralRe: CPropertySheet: Howto disable the cancel or abort button Pin
Yuancai (Charlie) Ye8-Apr-02 7:46
memberYuancai (Charlie) Ye8-Apr-02 7:46 
GeneralSocketPro updated with doc and more samples Pin
Yuancai (Charlie) Ye5-Apr-02 5:32
memberYuancai (Charlie) Ye5-Apr-02 5:32 
GeneralRe: SocketPro updated with doc and more samples Pin
K.K Chee7-Apr-02 23:12
memberK.K Chee7-Apr-02 23:12 
After reading some of your articles around this web site, I totally agreed to some of the readers comment that your knowledge in n-tier/COM/DCOM/JB/MQ is total OUT! And yet you always want to promote your work comparing to these rather mature technology, by giving false and baseless information. Note that your article will mislead many of those who want to learn. Shame on you!!

I get a kind of thought that you don't want to open your source is because most of them, might be copied from DUNDAS TCP/IP package?! I hope I am wrong and wish not to see your article again unless you change your xxxx attitude.
GeneralRe: SocketPro updated with doc and more samples Pin
Yuancai (Charlie) Ye8-Apr-02 4:05
memberYuancai (Charlie) Ye8-Apr-02 4:05 
GeneralRe: SocketPro updated with doc and more samples Pin
LJaxn21-Jan-04 2:18
memberLJaxn21-Jan-04 2:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.160426.1 | Last Updated 1 Apr 2002
Article Copyright 2002 by Yuancai (Charlie) Ye
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid