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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Service Detection [modified]

Service Detection [modified]

Scheduled Pinned Locked Moved C#
sysadminquestion
3 Posts 2 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.
  • D Offline
    D Offline
    Darkness84
    wrote on last edited by
    #1

    I have written a service that will be run on mutiple computers connected to the same network. However if the service is already running on one computer I don't want it to run on the other computers. Does anybody know if this is possible? -- modified at 18:34 Wednesday 7th March, 2007

    P 1 Reply Last reply
    0
    • D Darkness84

      I have written a service that will be run on mutiple computers connected to the same network. However if the service is already running on one computer I don't want it to run on the other computers. Does anybody know if this is possible? -- modified at 18:34 Wednesday 7th March, 2007

      P Offline
      P Offline
      pbraun
      wrote on last edited by
      #2

      Most things are possible given enough time and resources. The problem is that you will have independent processes running on independent machines that know nothing of each other. Somehow you have to get them to know about each others run status. The most common way of doing this is for them to connect to and query a server. This server can keep track of which computer is currently running the service. Hopefully that helps. Phil

      D 1 Reply Last reply
      0
      • P pbraun

        Most things are possible given enough time and resources. The problem is that you will have independent processes running on independent machines that know nothing of each other. Somehow you have to get them to know about each others run status. The most common way of doing this is for them to connect to and query a server. This server can keep track of which computer is currently running the service. Hopefully that helps. Phil

        D Offline
        D Offline
        Darkness84
        wrote on last edited by
        #3

        Thank you very much. Your post was most helpful. I created a table in the database that has one column called Running which I set to N. When the service first starts up it queries this table. If N is returned the service sets it to Y and it can start. If Y i returned the service cannot start. When the service which is running stops, it sets the row back to N.

        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