Click here to Skip to main content
15,914,500 members
Home / Discussions / C#
   

C#

 
GeneralRe: this.MaximumSize issue Pin
Giorgi Dalakishvili18-Feb-08 23:18
mentorGiorgi Dalakishvili18-Feb-08 23:18 
Generalsetting folder/file access after creation Pin
marky77718-Feb-08 22:33
marky77718-Feb-08 22:33 
GeneralRe: setting folder/file access after creation Pin
CKnig18-Feb-08 23:17
CKnig18-Feb-08 23:17 
GeneralRe: setting folder/file access after creation Pin
marky77718-Feb-08 23:42
marky77718-Feb-08 23:42 
GeneralRe: setting folder/file access after creation Pin
marky77719-Feb-08 0:00
marky77719-Feb-08 0:00 
General"Child is not a child control of this parant" Pin
kakanis18-Feb-08 22:14
kakanis18-Feb-08 22:14 
GeneralRe: "Child is not a child control of this parant" Pin
LongRange.Shooter19-Feb-08 8:03
LongRange.Shooter19-Feb-08 8:03 
GeneralFind multiple instance using Mutex Pin
CodingLover18-Feb-08 22:11
CodingLover18-Feb-08 22:11 
Hi all,

Again this is related to Mutex.

I'll explain my question as follows. I have a server application written using C++. Now I try to automate the server to start it automatically. So I write a .Net service to do that.

It's fine, my service is working fine.

But there is one issue. Actually my server can't run multiple server using the same IP. So I want to find is there any server running on specific IP.

So, I used Mutex.

Here what I have done. First get the each server IP from a data base and on each one test there is any instance going on.

private bool HasMultipleInstance(string IP)
{
    /*
     * No need to acquire or release the Mutex in .Net
     * */
    IPMutex = new Mutex( true, IP + "_mutex_" );
    //IPMutex.WaitOne();

    if( IPMutex != null )
    {
        EventLog.WriteEntry( "MyService", "Multiple Instances on " + IP );
        //IPMutex.ReleaseMutex();
        return false;
    }
    else
        return true;
}


What is your guys comment on this. Is that ok? Actually it write an entry to the event log, when a multiple instance is found..

Thanks in advanced Smile | :)

I appreciate your help all the time...
Eranga Smile | :)

GeneralRe: Find multiple instance using Mutex Pin
Giorgi Dalakishvili18-Feb-08 22:33
mentorGiorgi Dalakishvili18-Feb-08 22:33 
GeneralRe: Find multiple instance using Mutex Pin
CodingLover18-Feb-08 22:41
CodingLover18-Feb-08 22:41 
GeneralRe: Find multiple instance using Mutex Pin
Giorgi Dalakishvili18-Feb-08 22:58
mentorGiorgi Dalakishvili18-Feb-08 22:58 
GeneralRe: Find multiple instance using Mutex Pin
CodingLover18-Feb-08 23:41
CodingLover18-Feb-08 23:41 
GeneralRe: Find multiple instance using Mutex Pin
Giorgi Dalakishvili18-Feb-08 23:48
mentorGiorgi Dalakishvili18-Feb-08 23:48 
GeneralRe: Find multiple instance using Mutex Pin
CodingLover18-Feb-08 23:57
CodingLover18-Feb-08 23:57 
GeneralRe: Find multiple instance using Mutex Pin
Giorgi Dalakishvili19-Feb-08 0:01
mentorGiorgi Dalakishvili19-Feb-08 0:01 
GeneralRe: Find multiple instance using Mutex Pin
CodingLover20-Feb-08 17:44
CodingLover20-Feb-08 17:44 
Questioncreating graphs in C# .net Pin
Bhaskar Ravindranath18-Feb-08 22:10
Bhaskar Ravindranath18-Feb-08 22:10 
GeneralRe: creating graphs in C# .net Pin
Christian Graus18-Feb-08 22:13
protectorChristian Graus18-Feb-08 22:13 
GeneralMHT File Problem. Pin
hdv21218-Feb-08 21:53
hdv21218-Feb-08 21:53 
GeneralRe: MHT File Problem. Pin
Pete O'Hanlon18-Feb-08 22:23
mvePete O'Hanlon18-Feb-08 22:23 
GeneralRe: MHT File Problem. [modified] Pin
hdv21218-Feb-08 22:55
hdv21218-Feb-08 22:55 
GeneralRe: MHT File Problem. Pin
Pete O'Hanlon18-Feb-08 23:19
mvePete O'Hanlon18-Feb-08 23:19 
QuestionUpdate mysql table from datagridview Pin
baranils18-Feb-08 21:07
baranils18-Feb-08 21:07 
GeneralRe: Update mysql table from datagridview Pin
Mircea Puiu18-Feb-08 21:40
Mircea Puiu18-Feb-08 21:40 
GeneralRe: Update mysql table from datagridview Pin
baranils18-Feb-08 22:27
baranils18-Feb-08 22:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.