473,407 Members | 2,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

one instance of application on network

Sam
Hi,
I know how to allow only one instance of my .net application per user
using mutex.
Now I want to warn the user if someone else is using the application on
another pc of the same network.
How can I implement that ?

Thanks

Dec 15 '05 #1
7 1437
Do it the MS way, everytime your application opens, run a temp file to
sustain variables during the duration. When the application is opened a
second time it looks before creating the file, if the file exists, then you
can code for what you want to happen when more than one person is using the
program.

Randy

"Sam" wrote:
Hi,
I know how to allow only one instance of my .net application per user
using mutex.
Now I want to warn the user if someone else is using the application on
another pc of the same network.
How can I implement that ?

Thanks

Dec 15 '05 #2
Sam
Hi Randy,
Thank you for your reply.

Where should I create the temp file? Probably not on local machine
right?

Dec 16 '05 #3
Sam,
Thank you for your reply.

Where should I create the temp file? Probably not on local machine
right?


No this is a solution using a Network share, however it is a deadly
solution, just because of the deadlock

The idea is to create a token as a program opens and remove that when it
closes. But if the user in a network environment (and I have seen a lot of
those), just put the power down than you have a deadlock.

If you really want this than is in my idea the only solution to build
service mechanisme using remoting that polls everytime the program that has
told that he is busy. A real expensive mechanisme (to build) in my opinion.
I do not have a sample for you and never did this.

Just as idea,

Cor
Dec 16 '05 #4
Sam
Ok Cor Thanks. Sounds pretty depressive :-)

Dec 16 '05 #5
Well i have built a mechanism like this ,,, and it turned out to be quit
simple

on start of your program just let it broadcast a wakeup message ( with a
signature you provide ) , your program already running listens for incoming
messages with this specific signature and returns a apropriate message

i used this for a remoting project ,,, however before i started the remote
object from the client i wanted to make sure that

1. a remoting server was running and wich version
2. what the settings were for the remote server ( ip adress , port number )
3. wich server was the most powerfull server
4. wich server had the lowest load

so i implemented a broadcast mechanism on the UDP protocol ,,, i can write a
small example for you if you want
tell me wich version you use of VS.Net ( 2003 or 2005 ) this for testing
purposes of the test proggy ( as i use the code in both versions without a
change )

regards

Michel Posseth [MCP]

"Sam" <re************@hotmail.co.uk> schreef in bericht
news:11*********************@g44g2000cwa.googlegro ups.com...
Hi,
I know how to allow only one instance of my .net application per user
using mutex.
Now I want to warn the user if someone else is using the application on
another pc of the same network.
How can I implement that ?

Thanks

Dec 18 '05 #6

just to be sure you understand what i mean

the starting new program starts , performs a broadcast ( annybody out there
?? )
the already running program listens on a specific port and receives this
message and answers ( yes i am here )

the starting program now nows it can show a message to the user and quit

this technique is the safest way in my opinion ( can`t deadlock )

the implementation is verry simple ( a few lines of code .... 130 to be
exact :-)

regards

Michel Posseth [MCP]


"m.posseth" <po*****@planet.nl> wrote in message
news:%2*****************@TK2MSFTNGP12.phx.gbl...
Well i have built a mechanism like this ,,, and it turned out to be quit
simple

on start of your program just let it broadcast a wakeup message ( with a
signature you provide ) , your program already running listens for
incoming messages with this specific signature and returns a apropriate
message

i used this for a remoting project ,,, however before i started the remote
object from the client i wanted to make sure that

1. a remoting server was running and wich version
2. what the settings were for the remote server ( ip adress , port
number )
3. wich server was the most powerfull server
4. wich server had the lowest load

so i implemented a broadcast mechanism on the UDP protocol ,,, i can write
a small example for you if you want
tell me wich version you use of VS.Net ( 2003 or 2005 ) this for
testing purposes of the test proggy ( as i use the code in both versions
without a change )

regards

Michel Posseth [MCP]

"Sam" <re************@hotmail.co.uk> schreef in bericht
news:11*********************@g44g2000cwa.googlegro ups.com...
Hi,
I know how to allow only one instance of my .net application per user
using mutex.
Now I want to warn the user if someone else is using the application on
another pc of the same network.
How can I implement that ?

Thanks


Dec 18 '05 #7
Sam
Hi Michel,
Woah, that sounds good! Except I don't know much about network
programming:-( I wouldn't mind an example indeed if you have time for
that! But I understood the theory at least, thanks to your
explanations.

Thank you.

Dec 19 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: John C | last post by:
Hi, I am a little uncertain about the concept of passing a reference to a class to another instance of a class. for instance I thought that the following was ok: Network network = Network();...
3
by: kathy | last post by:
I have a general question. If I write a application using any language(C/C++/C#/VB). How to make sure it only has one instance running? What I need to write in source code? If multi-instances...
8
by: Pete Wittig | last post by:
Hello, I am wondering if it is possible to create a networked application with C# that is seen as a windows user. For example, if Bob logged onto windows and then started the application, any...
8
by: Li Pang | last post by:
Hi I want to run my app only one instance, i.e. only one session is allowed to display Thank
0
by: ricky | last post by:
I found the code below on how to check for a previous instance of an app, but I don't think this will work for a network executeable. So, how do you check to see if there is multiple instances of...
1
by: steve1rm | last post by:
Hello, I have a problem trying to connect a remote sql server. The error: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may...
6
by: HolyShea | last post by:
All, Not sure if this is possible or not - I've created a class which performs an asynchronous operation and provides notification when the operation is complete. I'd like the notification to be...
6
by: JB | last post by:
Hi All, I'm building a DLL that can be used by several applications. I'd like to have one single instance of a Class stored in my DLL that would be ("shared") by all the applications using that...
1
by: johnyjj2 | last post by:
Hello! I've got web application created for MSSQL and IIS. There are two directories in this application - Scripts and WebSite. In Script there is file CreateDb.sql. I need to run it so that it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.