COM local server
-
Hello I have two COM local servers developed using ATL. The local servers have interface pointers to each other and the pointers will be released when Stop()is called from a client to each server. The client will also release its pointers to the servers and both components will die (lock count == 0). Now to my problem. If one of the components crash I have a problem to shut down the other server. The still running server will have a lock count from the allready dead server. I would be very happy if someone could give me a sugestion how to solve this. Johan
-
Hello I have two COM local servers developed using ATL. The local servers have interface pointers to each other and the pointers will be released when Stop()is called from a client to each server. The client will also release its pointers to the servers and both components will die (lock count == 0). Now to my problem. If one of the components crash I have a problem to shut down the other server. The still running server will have a lock count from the allready dead server. I would be very happy if someone could give me a sugestion how to solve this. Johan
Can I ask why you're not concentrating on preventing the 'crash' instead of putting effort into trying to deal with the after effects of such a crash?
-
Can I ask why you're not concentrating on preventing the 'crash' instead of putting effort into trying to deal with the after effects of such a crash?
The local servers are running on an embedded device with Windows CE. Before release everything should be tested as good as possible but there is still a risk for crashes. The most obvious would be to implement a watchdog which would reset the device but this is not an option because of the long boot time of the operating system. Each server implements a watchdog configured to terminate the server process. This termination will be notised by the client and the client restarts the terminated server. One way to shut down servers who refuse to die is to send WM_QUIT to it. This whould probably work because this is what happen when the lock count reach zero. This solution is very ugly and I am looking for the right way to do it. There must be a standard solution for problems like this.
-
The local servers are running on an embedded device with Windows CE. Before release everything should be tested as good as possible but there is still a risk for crashes. The most obvious would be to implement a watchdog which would reset the device but this is not an option because of the long boot time of the operating system. Each server implements a watchdog configured to terminate the server process. This termination will be notised by the client and the client restarts the terminated server. One way to shut down servers who refuse to die is to send WM_QUIT to it. This whould probably work because this is what happen when the lock count reach zero. This solution is very ugly and I am looking for the right way to do it. There must be a standard solution for problems like this.
I've never done abything on CE but how about...
Johan.Wade wrote:
This termination will be notised by the client and the client restarts the terminated server.
If your client can notice that one of the local servers has been termnated, the client must then be able to instruct the other non-terminated server to ignore the pointer it holds to the terminated server. To recover the client can then set up a new server and by some mechanism have them 'discover' each other to set up new pointers. During the 'instruction to ignore the other server', that is prior to the 'discover' phase, the server must be instructed by the client to internally call Release to restore the existing servers count to 1.
-
Hello I have two COM local servers developed using ATL. The local servers have interface pointers to each other and the pointers will be released when Stop()is called from a client to each server. The client will also release its pointers to the servers and both components will die (lock count == 0). Now to my problem. If one of the components crash I have a problem to shut down the other server. The still running server will have a lock count from the allready dead server. I would be very happy if someone could give me a sugestion how to solve this. Johan
Johan.Wade wrote:
Now to my problem. If one of the components crash I have a problem to shut down the other server. The still running server will have a lock count from the allready dead server. I would be very happy if someone could give me a sugestion how to solve this.
There is an IExternalConnection interface which can help in your troubles.
With best wishes, Vita