Search code examples
lotus-noteslotus-dominolotusscript

Checking connection status with Domino server


Is it is possible to check the connection status with Domino server using a C# API?

I have a C# application, and I have to check if the connection with the Domino server is still alive or thr Domino server restarts and I lose thr connection. How I can check that programmatically?


Solution

  • Something like this ought to do the trick. If this fails then the connection to the server couldn't be made.

    Domino.NotesSession s = new Domino.NotesSession();
    Domino.NotesDatabase db;
    
    try
    {
       LNSession.Initialize("password");
       LNDatabase = LNSession.GetDatabase("my lotus mail server", @"names.nsf", false);
    }
    catch (Exception e)   // Not sure on the specific exception
    {
       // Connection failed
    }