NTP Analyzer  0.8.2
Analyze the operation of time servers
Ntp.Common.System.InterProcess Class Reference

Public Types

enum  Signal {
  Signal.Error = 0, Signal.Exit, Signal.Reload, Signal.Refresh,
  Signal.Notify
}
 

Static Public Member Functions

static Signal Wait (string name, LogBase log)
 

Static Private Attributes

static UnixSignal sighup
 
static UnixSignal sigint
 
static readonly UnixSignal[] Signals
 
static UnixSignal sigquit
 
static UnixSignal sigterm
 
static UnixSignal sigusr1
 
static UnixSignal sigusr2
 

Detailed Description

Definition at line 29 of file InterProcess.cs.

Member Enumeration Documentation

Enumerator
Error 
Exit 
Reload 
Refresh 
Notify 

Definition at line 31 of file InterProcess.cs.

32  {
33  Error = 0,
34  Exit,
35  Reload,
36  Refresh,
37  Notify
38  }

Member Function Documentation

static Signal Ntp.Common.System.InterProcess.Wait ( string  name,
LogBase  log 
)
inlinestatic

Definition at line 52 of file InterProcess.cs.

References e.

Referenced by Ntp.Common.System.SignalHandler.Execute().

53  {
54  while (true)
55  {
56  int i;
57  try
58  {
59  i = UnixSignal.WaitAny(Signals, -1);
60  }
61  catch (Exception e)
62  {
63  log.SignalError(e);
64  return Signal.Error;
65  }
66 
67  if (i < 0 || i >= Signals.Length)
68  {
69  log.UnknownSignal(Signals[i].Signum.ToString());
70  continue;
71  }
72 
73  log.ReceivedSignal(Signals[i].Signum.ToString());
74 
75  if (sigint.IsSet || sigterm.IsSet || sigquit.IsSet)
76  {
77  sigint.Reset();
78  sigterm.Reset();
79  sigquit.Reset();
80  return Signal.Exit;
81  }
82 
83  if (sighup.IsSet)
84  {
85  sighup.Reset();
86  return Signal.Refresh;
87  }
88 
89  if (sigusr1.IsSet)
90  {
91  sigusr1.Reset();
92  return Signal.Reload;
93  }
94 
95  if (sigusr2.IsSet)
96  {
97  sigusr2.Reset();
98  return Signal.Notify;
99  }
100  }
101  }
var e
Definition: bootstrap.min.js:6
static readonly UnixSignal[] Signals
Definition: InterProcess.cs:42

Here is the caller graph for this function:

Member Data Documentation

UnixSignal Ntp.Common.System.InterProcess.sighup
staticprivate

Definition at line 40 of file InterProcess.cs.

UnixSignal Ntp.Common.System.InterProcess.sigint
staticprivate

Definition at line 40 of file InterProcess.cs.

readonly UnixSignal [] Ntp.Common.System.InterProcess.Signals
staticprivate
Initial value:
=
{
sigint = new UnixSignal(Signum.SIGINT),
sigterm = new UnixSignal(Signum.SIGTERM),
sigquit = new UnixSignal(Signum.SIGQUIT),
sighup = new UnixSignal(Signum.SIGHUP),
sigusr1 = new UnixSignal(Signum.SIGUSR1),
sigusr2 = new UnixSignal(Signum.SIGUSR2)
}

Definition at line 42 of file InterProcess.cs.

UnixSignal Ntp.Common.System.InterProcess.sigquit
staticprivate

Definition at line 40 of file InterProcess.cs.

UnixSignal Ntp.Common.System.InterProcess.sigterm
staticprivate

Definition at line 40 of file InterProcess.cs.

UnixSignal Ntp.Common.System.InterProcess.sigusr1
staticprivate

Definition at line 40 of file InterProcess.cs.

UnixSignal Ntp.Common.System.InterProcess.sigusr2
staticprivate

Definition at line 40 of file InterProcess.cs.


The documentation for this class was generated from the following file: