Click here to Skip to main content
Click here to Skip to main content

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.

Introduction

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.

Notes

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.

License

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

Share

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 http://www.udaparts.com. 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.

Comments and Discussions

 
General[Message Deleted] Pinmemberit.ragester2-Apr-09 22:51 
Generaltool to convert DCOM interface to tcp/ip interface Pinmemberzabush27-Jun-04 11:35 
GeneralRe: tool to convert DCOM interface to tcp/ip interface PinsussAnnomous18-Oct-04 12:47 
GeneralMy thoughts exactly! Pinmemberbsamwel8-Apr-02 6:27 
GeneralSee these statements from Microsoft PinmemberYuancai (Charlie) Ye17-Apr-02 6:35 
GeneralRe: See these statements from Microsoft PinmemberTim Smith17-Apr-02 6:46 
GeneralRe: See these statements from Microsoft PinmemberYuancai (Charlie) Ye17-Apr-02 7:05 
GeneralRe: See these statements from Microsoft PinmemberTim Smith17-Apr-02 7:09 
GeneralRe: See these statements from Microsoft PinmemberYuancai (Charlie) Ye19-Apr-02 9:11 
GeneralRe: See these statements from Microsoft PinmemberTim Smith19-Apr-02 9:59 
GeneralRe: My thoughts exactly! PinmemberNorm Almond17-Apr-02 7:19 
GeneralRe: My thoughts exactly! PinmemberLJaxn21-Jan-04 2:58 
GeneralCPropertySheet: Howto disable the cancel or abort button PinmemberRainer Mangold8-Apr-02 5:07 
GeneralRe: CPropertySheet: Howto disable the cancel or abort button PinmemberYuancai (Charlie) Ye8-Apr-02 8:46 
GeneralSocketPro updated with doc and more samples PinmemberYuancai (Charlie) Ye5-Apr-02 6:32 
Hi, All
I updated SocketPro with its documentation and more samples. See the site http://www.udaparts.com. It will takes a while for Codeproject to publish my this updated article
 
Yuancai (Charlie) Ye
GeneralRe: SocketPro updated with doc and more samples PinmemberK.K Chee8-Apr-02 0:12 
GeneralRe: SocketPro updated with doc and more samples PinmemberYuancai (Charlie) Ye8-Apr-02 5:05 
GeneralRe: SocketPro updated with doc and more samples PinmemberLJaxn21-Jan-04 3:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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
Web04 | 2.8.141223.1 | Last Updated 1 Apr 2002
Article Copyright 2002 by Yuancai (Charlie) Ye
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid