Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

DCOM Connection Points

Posted on 2002-07-10
8
Medium Priority
?
512 Views
Last Modified: 2013-11-20
NT/98/2K

I have a DCOM Server that uses connection points to update clients when changes are made at any connected PC. To stop the server freezing when it is attempting to update a client that has vanished from the network I implemented the connection point call in a seperate thread.

This works OK, except now I want to stop sending messages to any client that has stopped responding, because this code is auto-generated by the VC++ wizard I am unsure how to proceed.

Should I re-write the auto-generated functions (Fire...) so that I can interrogate any DCOM errors? Or is there an alternate method for doing this?

Is there a way to disconnect a connection point from within the server if it believes the client has gone away permanently?

Thanks.
0
Comment
Question by:sdj_work
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 2

Expert Comment

by:vbk_bgm
ID: 7145116
the wizard generates a proxy class that has Fire_xxxxx  methods. This class has a member of type CComDynamicUnkArray. From this you can find the client interface pointer which is not responding. Just call Release and remove the pointer from the array.
0
 

Author Comment

by:sdj_work
ID: 7145956
Thanks,

How do I get the CComDynamicUnkArray? I can not see a member function of IConnectionPointImpl that returns this value so that I can use it in my Update object.

0
 
LVL 2

Expert Comment

by:vbk_bgm
ID: 7148097
It is a member variable m_vec.
int i=0; //index of the interface pointer desired
IUnknown *ptr = m_vec.GetAt(i);
ptr->Release();
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:sdj_work
ID: 7148589
Yes, I realise that now. Although while I have been trying to do my own error checking I have noticed that whenever there is an error from the IDispatch a KERNEL exception is thrown and at my end I am given no indication of the failure.

However after a defined period the connection point is automatically released! Is this part of COM garbage collection? Is there somewhere that specifies what the timings are, I seem to recall that there is a fixed timeout within DCOM?
0
 
LVL 2

Expert Comment

by:vbk_bgm
ID: 7150769
A connection point is not broken automatically. It is broken only whne a client calls UnAdvise. There could be some other problem. Could you post your code.
0
 

Author Comment

by:sdj_work
ID: 7153607
The connection point is being terminated without any help from my code. It terminates my Update Object in a graceful manner if it is unable to complete the Dispatch after 10 minutes of trying.

I have sat watching the server in the debugger while doing nothing. It attempts to make the call reports a KERNEL32.EXE exception along with a DCOM failure in the output window (RPC Call Failure). This is not passed on to the server application but eventually if the network is not restored a request is made to remove the update object, this goes nicely through my deconstructor. Everything else continues to run fine.

It seemed fairly reasonable to assume that somewhere in side the marshalling code (which appears to be in a separate thread) DCOM is doing the retry work for me, and then calling UnAdvise at the point that it timeouts.

I seem to recall there is a 10 minute timeout built in to DCOM and this can only be changed by using custom marshalling.
0
 
LVL 2

Accepted Solution

by:
vbk_bgm earned 1500 total points
ID: 7155690
As far I know, there is a 6-minute time-out period used for DCOM garbage collection. If a client dies prematurely and the server is an EXE then the server exits after 6 minutes of client death.
    Anyway, things seem to be working fine for you.
0
 

Author Comment

by:sdj_work
ID: 7187910
Thanks for your help.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question