Click here to Skip to main content
13,091,996 members (60,193 online)
Click here to Skip to main content
Add your own
alternative version


25 bookmarked
Posted 30 Jan 2002

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
Software Developer (Senior)
United States United States
Yuancai (Charlie) Ye, an experienced C/C++ software engineer, lives in Atlanta, Georgia. He is an expert at continuous inline request/result batching, real-time stream processing, asynchronous data transferring and parallel computation for the best communication throughput and latency. He has been working at SocketPro ( for more than fifteen years.

You may also be interested in...


Comments and Discussions

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 

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.

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