Solved

DCOM Connection Points

Posted on 2002-07-10
8
479 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
  • 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
 

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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now