deps/PicklingTools170Release/Xm/ptools170/host/valpipe.cc
void openUpServer(MidasServer& ms, Tab& tr, real_8 wait)
{
  // Set the start time.
  real_8 tnow, ft;
  m_now(tnow, ft);
  tnow += ft;

  // Is it time to try and open again.
  if (tnow < real_8(tr["TRYTIME"])) {
    return;
  }

  // Open the Midas Talker/Server.
  try {
    ms.open(wait);
    m_info("Connection Open: [" + ms.host() + "@" + Stringize(ms.port()) + "]");
    tr["UPTIME"] = tnow;
    tr["ISOPEN"] = true;
    if (Mu->verbose) {
      tr.prettyPrint(cerr);
    }
  }
  // Open failed, set to try again later.
  catch (const runtime_error& e) {
    if (bool(tr["ISOPEN"])) {
      m_warning("Problem: " + Stringize(e.what()));
      m_advisory("Connection Failed: [" + ms.host() + "@" + Stringize(ms.port()) +
        "] attempting to reconnect...");

      // Set to false and only display once.
      tr["ISOPEN"] = false;
      if (Mu->verbose) {
        tr.prettyPrint(cerr);
      }
    }

    tr["ISOPEN"] = false;
    tr["TRYTIME"] = tnow + wait;
  }
}
//////////////////////////////////////////////////////////////////////////////
// FUNCTION: openUpServer
//
// DESCRIPTION:
//   Tries to open up a connection for a MidasServer.
//
//////////////////////////////////////////////////////////////////////////////
openUpServer
DESCRIPTION:
Tries to open up a connection for a MidasServer.
openUpServer DESCRIPTION : Tries to open up a connection for a MidasServer .
void openUpServer(MidasServer& ms, Tab& tr, real_8 wait)
{
  real_8 tnow, ft;
  m_now(tnow, ft);
  tnow += ft;
  if (tnow < real_8(tr["TRYTIME"])) {
    return;
  }
  try {
    ms.open(wait);
    m_info("Connection Open: [" + ms.host() + "@" + Stringize(ms.port()) + "]");
    tr["UPTIME"] = tnow;
    tr["ISOPEN"] = true;
    if (Mu->verbose) {
      tr.prettyPrint(cerr);
    }
  }
  catch (const runtime_error& e) {
    if (bool(tr["ISOPEN"])) {
      m_warning("Problem: " + Stringize(e.what()));
      m_advisory("Connection Failed: [" + ms.host() + "@" + Stringize(ms.port()) +
        "] attempting to reconnect...");
      tr["ISOPEN"] = false;
      if (Mu->verbose) {
        tr.prettyPrint(cerr);
      }
    }
    tr["ISOPEN"] = false;
    tr["TRYTIME"] = tnow + wait;
  }
}
void openUpServer ( MidasServer & ms , Tab & tr , real_8 wait ) { real_8 tnow , ft ; m_now ( tnow , ft ) ; tnow += ft ; if ( tnow < real_8 ( tr [ " " ] ) ) { return ; } try { ms . open ( wait ) ; m_info ( " " + ms . host ( ) + " " + Stringize ( ms . port ( ) ) + " " ) ; tr [ " " ] = tnow ; tr [ " " ] = true ; if ( Mu -> verbose ) { tr . prettyPrint ( cerr ) ; } } catch ( const runtime_error & e ) { if ( bool ( tr [ " " ] ) ) { m_warning ( " " + Stringize ( e . what ( ) ) ) ; m_advisory ( " " + ms . host ( ) + " " + Stringize ( ms . port ( ) ) + " " ) ; tr [ " " ] = false ; if ( Mu -> verbose ) { tr . prettyPrint ( cerr ) ; } } tr [ " " ] = false ; tr [ " " ] = tnow + wait ; } }
FUNCTION: openUpServer
DESCRIPTION:
Tries to open up a connection for a MidasServer.
FUNCTION : openUpServer DESCRIPTION : Tries to open up a connection for a MidasServer .
// Set the start time. // Is it time to try and open again. // Open the Midas Talker/Server. // Open failed, set to try again later. // Set to false and only display once.