Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. COM local server

COM local server

Scheduled Pinned Locked Moved COM
c++comsysadminhelptutorial
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Johan Wade
    wrote on last edited by
    #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

    J V 2 Replies Last reply
    0
    • J Johan Wade

      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

      J Offline
      J Offline
      Jonathan Davies
      wrote on last edited by
      #2

      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?

      J 1 Reply Last reply
      0
      • J Jonathan Davies

        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?

        J Offline
        J Offline
        Johan Wade
        wrote on last edited by
        #3

        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.

        J 1 Reply Last reply
        0
        • J Johan Wade

          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.

          J Offline
          J Offline
          Jonathan Davies
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • J Johan Wade

            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

            V Offline
            V Offline
            Vi2
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups