Re: Find Previous Instance on another computer?
From: Björn Holmgren (bjohol_at_hotmail.com)
Date: 04/02/04
- Next message: Tony Proctor: "Re: Will another cpu help??"
- Previous message: Björn Holmgren: "Re: Quck Question?"
- In reply to: Martin: "Find Previous Instance on another computer?"
- Next in thread: Martin: "Re: Find Previous Instance on another computer?"
- Reply: Martin: "Re: Find Previous Instance on another computer?"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 2 Apr 2004 10:07:08 +0200
Martin,
It has been suggested you use some sort of flag (like a file) and you have
also received some ideas on how to deal with flags left active by a
"crashing" application. This is all fine except the application has to have
some sort of common storage location (in your case, the PLC seems to be the
most logical solution). But what if you want to create an application that
doesn't need a common file share, a database, a server component etc?
One solution that has worked perfectly for me, is to use winsock, and have
the application listen for a broadcast or (more ideally) a multicast packet
and respond to the sender. When the application starts, it
broadcasts/multicasts a packet and waits a few seconds for a response. If no
response is received, it's probably safe to assume that there are no other
running instances.
I know you were looking for a simple solution - this isn't exactly simple as
it involves some winsock api programming (at least for multicasting) - but I
thought you might want to know about it anyway.
-- Björn Holmgren Guide Konsult AB "Martin" <martinvalley@comcast.net> wrote in message news:lpvo60hmm3dhvtlej4cji19oahi651r7nn@4ax.com... > Is there a way to find out if a specific application is currently > running on another computer? > > I use App.PrevInstance in my VB6 program to assure that a second > instance can't be started on the same computer. I would like to also > check a second computer for the same reason. The name (and the IP > address) of the second computer is known and it's on the same LAN (one > is a backup for the other). > > I want to warn the operator that the program is running on EITHER > computer when he tries to start it on either computer. > > How should I do this?
- Next message: Tony Proctor: "Re: Will another cpu help??"
- Previous message: Björn Holmgren: "Re: Quck Question?"
- In reply to: Martin: "Find Previous Instance on another computer?"
- Next in thread: Martin: "Re: Find Previous Instance on another computer?"
- Reply: Martin: "Re: Find Previous Instance on another computer?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|