Solved

DCOM Connection Points

Posted on 2002-07-10
8
494 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
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

829 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