Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

nml_srv.hh File Reference

#include "rcs_defs.hh"
#include <sys/types.h>
#include <unistd.h>
#include "cms_srv.hh"
#include "nml.hh"
#include "rem_msg.hh"

Include dependency graph for nml_srv.hh:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Data Structures

class  NML_SERVER_LOCAL_PORT
class  NML_SERVER
class  NML_SUPER_SERVER

Functions

void RCS_EXPORT run_nml_servers ()
void RCS_EXPORT spawn_nml_servers ()
void RCS_EXPORT kill_nml_servers ()
void RCS_EXPORT nml_server_cleanup ()

Variables

RCS_EXPORT NML_SUPER_SERVERNML_Default_Super_Server


Function Documentation

void RCS_EXPORT run_nml_servers  
 

Definition at line 686 of file nml_srv.cc.

00687 {
00688 #if defined(sun4os5) || defined(__MSDOS__) && !defined(WIN32)
00689   atexit (nml_cleanup);
00690 #endif
00691   if (NULL != NML_Default_Super_Server)
00692     {
00693       if (NML_Default_Super_Server->servers != NULL)
00694         {
00695           if (NML_Default_Super_Server->servers->list_size <
00696               NML_Default_Super_Server->unspawned_servers)
00697             {
00698               NML_Default_Super_Server->unspawned_servers =
00699                 NML_Default_Super_Server->servers->list_size;
00700             }
00701           if (NML_Default_Super_Server->unspawned_servers <= 0)
00702             {
00703               rcs_print_error
00704                 ("run_nml_servers(): No buffers without servers already spawned for them.\n");
00705               return;
00706             }
00707           if (NML_Default_Super_Server->unspawned_servers == 1)
00708             {
00709               NML_Default_Super_Server->unspawned_servers = 0;
00710               NML_SERVER *sole_server;
00711               sole_server =
00712                 (NML_SERVER *) NML_Default_Super_Server->servers->get_head ();
00713               while (sole_server != NULL)
00714                 {
00715                   if (NULL != sole_server->remote_port)
00716                     {
00717                       if (!sole_server->remote_port->running &&
00718                           !sole_server->server_spawned)
00719                         {
00720                           break;
00721                         }
00722                     }
00723                   sole_server =
00724                     (NML_SERVER *) NML_Default_Super_Server->servers->
00725                     get_next ();
00726                 }
00727               if (NULL == sole_server)
00728                 {
00729                   rcs_print_error
00730                     ("run_nml_servers() : sole_server is NULL.\n");
00731                   run_nml_server_exit (-1);
00732                 }
00733               else
00734                 {
00735 #ifndef UNDER_CE
00736 #if defined(WIN32) && !defined(gnuwin32)
00737                   SetConsoleCtrlHandler (catch_control_C1, TRUE);
00738 #else
00739 #ifdef sparcworks_sun4
00740                   signal (SIGINT, (void (*)(int,...)) catch_control_C1);
00741 #else
00742                   signal (SIGINT, catch_control_C1);
00743 #endif
00744 #endif
00745 #endif
00746                   sole_server->run (0);
00747                   run_nml_server_exit (-1);
00748                 }
00749             }
00750           else
00751             {
00752               nml_control_C_caught = 0;
00753               NML_Default_Super_Server->spawn_all_servers ();
00754 #ifndef UNDER_CE
00755 #if defined(WIN32) && !defined(gnuwin32)
00756               SetConsoleCtrlHandler (catch_control_C2, TRUE);
00757 #else
00758 #ifdef sparcworks_sun4
00759               signal (SIGINT, (void (*)(int,...)) catch_control_C2);
00760 #else
00761               signal (SIGINT, catch_control_C2);
00762 #endif
00763 #endif
00764 #endif
00765               while (!nml_control_C_caught)
00766                 esleep (2.0);
00767               NML_Default_Super_Server->kill_all_servers ();
00768               nml_cleanup ();
00769               run_nml_server_exit (0);
00770             }
00771         }
00772       else
00773         {
00774           rcs_print_error
00775             ("run_nml_servers(): No buffers without servers already spawned for them.\n");
00776         }
00777     }
00778   else
00779     {
00780       rcs_print_error
00781         ("run_nml_servers(): No buffers without servers already spawned for them.\n");
00782     }
00783   run_nml_server_exit (-1);
00784 }

void RCS_EXPORT spawn_nml_servers  
 

Definition at line 787 of file nml_srv.cc.

00788 {
00789   if (NULL != NML_Default_Super_Server)
00790     {
00791       NML_Default_Super_Server->spawn_all_servers ();
00792     }
00793 }

void RCS_EXPORT kill_nml_servers  
 

Definition at line 796 of file nml_srv.cc.

00797 {
00798   if (!dont_kill_servers)
00799     {
00800       if (NULL != NML_Default_Super_Server)
00801         {
00802           NML_Default_Super_Server->kill_all_servers ();
00803         }
00804     }
00805 }

void RCS_EXPORT nml_server_cleanup  
 

Definition at line 808 of file nml_srv.cc.

00809 {
00810   if (!dont_cleanup_servers)
00811     {
00812       if (NULL != NML_Default_Super_Server)
00813         {
00814           NML_Default_Super_Server->kill_all_servers ();
00815           NML_Default_Super_Server->delete_all_servers ();
00816 #ifdef VXWORKS
00817           if (NULL != NML_Default_Super_Server->servers)
00818             {
00819               if (0 == NML_Default_Super_Server->servers->list_size)
00820                 {
00821 #endif
00822                   delete NML_Default_Super_Server;
00823                   NML_Default_Super_Server = (NML_SUPER_SERVER *) NULL;
00824 #ifdef VXWORKS
00825                 }
00826             }
00827 #endif
00828         }
00829     }
00830 }


Variable Documentation

RCS_EXPORT NML_SUPER_SERVER* NML_Default_Super_Server
 

Definition at line 99 of file nml_srv.hh.


Generated on Sun Dec 2 15:57:18 2001 for rcslib by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001