Solved

DCOM Connection Points

Posted on 2002-07-10
8
490 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to create frequencies of a variable from SAS dataset? 10 125
Expand LInux Boot partition remotly 3 91
has22 challenge 11 96
wordappend challenge 8 181
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…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

832 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