?
Solved

Detecting client disconnect in an out of process DCOM server.

Posted on 2003-03-05
6
Medium Priority
?
501 Views
Last Modified: 2010-04-16
Hi,

The title says it all.
Is it possible to detect a client disconnect from an out of process server so that some action may be taken.

I need to detect the not so graceful disconnects and reboots.

Thanks
Regards
Craig
0
Comment
Question by:cmain
[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
  • 3
  • 2
6 Comments
 
LVL 2

Expert Comment

by:steve_hsk
ID: 8079060
Hi Craig ...

yes of course you can detect this. It depends on how you have created and setup your sockets.

One method I use is Socket Network Events.

General Approximate Example ...

m_aSocketHandle := WSACreateEvent;

bind (m_tUDPSock, @m_tpAddress, sizeof(tSockAddrIn))

WSAEventSelect (m_tUDPSock, m_aSocketHandle, FD_READ OR FD_CLOSE)

dwWaitReturn := WaitForMultipleObjects (2,@m_aSocketHandle,
FALSE,INFINITE);

IF (dwEventTrig = 1 ) THEN
BEGIN
    IF NOT (WSAENUMNetworkEvents (m_tUDPSock, m_aSocketHandle, m_tpEvent) = SOCKET_ERROR) THEN
    BEGIN
         IF (m_tpEvent.lNetworkEvents = FD_READ) THEN
         BEGIN
              // Read Data;
         END
         ELSE IF (m_tpEvent.lNetworkEvents = FD_CLOSE) THEN
         BEGIN
              // Handle Closure
         END;
     END;
END;

If you need a full exmaple, or if I have the wrong concept, let me know :-)

Hope this Helps,
Steve
0
 
LVL 21

Expert Comment

by:ziolko
ID: 8079069
listening..
0
 
LVL 2

Expert Comment

by:steve_hsk
ID: 8079090
Craig,

sorry ... should have read the question properly ...

missed the DCOM KEY word ... will revise and get back to you after a couple of very strong coffee's !!!

Steve
0
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!

 
LVL 21

Expert Comment

by:ziolko
ID: 8079729
You mean disconnect by syste or network cradh or disconnect by user's action??.
ziolko
0
 
LVL 2

Accepted Solution

by:
steve_hsk earned 1200 total points
ID: 8081122
Craig,

I've checked with a collegue, and apparently the short answer is no you can't detect. If your using a container like MTS or equivalent, then the Marshelling and overhead is automatically cleared up for you and so there is no need to detect, although this event isn't raised in the server side.

It's not the done thing to have the server check all it's clients are active either. So if you do require the detection of a client "crash", then you could design a simple transaction that each client would initiate with the server ... you're own "keep-alive" so to speak. The server would log these transactions, and when inspecting this record or log, raise the necessary event to your app code, for you to action accordingly.

Maybe this is a lil more helpful ?
Steve
0
 
LVL 1

Author Comment

by:cmain
ID: 8171805
Thanks
I have gathered that it is pretty much not possible without a lot of work.

Regards
Craig.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

762 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