network communication with .NET

K

kathy

We need runing one program on two computers, say two
computers runing a program on a network drive, we would
like one is a main program, the other one as secondary.
Is there any way the main one know the second one closing
or killed the second one from the main one?

More, is there a way the main program start the second
computer?

This is not limit to the two the comupter on one network.
If there is a simpler way, say the two comupter being
contacted with some cable.
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi Kathy,

Well your message is far from clear :) I will try to help you the best I
can
We need runing one program on two computers, say two
computers runing a program on a network drive, we would
like one is a main program, the other one as secondary.
Is there any way the main one know the second one closing
or killed the second one from the main one?

I assume that you mean that a program exist on a driver that is accesible to
the two computers and both of them execute the program , this is easily
doable, all you may have to do is set the correct permission.
regarding to the "role" of each running application, it depends of how you
assign the master role , you may then assign the secundary one to all others
instances of the program. this could be done in several ways, a very simple
one ( and not the best one ) is that as all the computers run the program
from the same location you can use a flag file for indicate the master,
let's say that the master instance when start executing create a file in the
form MASTER.COMPUTERNAME in this way all the others computers knows that the
instance running on COMPUTERNAME is the master.

a similar idea can be used to indicate to the master than the secundary is
closed, the secondary can create a file like SECONDARY.COMPUTERNAME and
delete it when it exit, the master instance can check for this file. to
close the secondary you could for example delete the file and this would be
used as a signal for the secondary program to close itself.


Please note that the above is only an idea, it's not the best idea by far.

This is not limit to the two the comupter on one network.
If there is a simpler way, say the two comupter being
contacted with some cable.
I have no idea of what you mean with this !!!!.

Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top