public void Signal() { SignalTest st = new SignalTest(); // Insert handler SignalHandler oh = Stdlib.signal(Signum.SIGURG, new SignalHandler(st.Handler)); st.signalReceived = ~NativeConvert.FromSignum(Signum.SIGURG); // Send signal Stdlib.raise(Signum.SIGURG); Assert.IsTrue( NativeConvert.ToSignum(st.signalReceived) == Signum.SIGURG, "#IH: Signal handler not invoked for SIGURG"); // Reset old signal Stdlib.signal(Signum.SIGURG, oh); st.signalReceived = NativeConvert.FromSignum(Signum.SIGUSR1); Stdlib.raise(Signum.SIGURG); Assert.IsFalse(NativeConvert.ToSignum(st.signalReceived) == Signum.SIGURG, "#IH: Signal Handler invoked when it should have been removed!"); }
public void RegisterSignalHandlers() { // Connect to SIGTERM and SIGINT, so we don't lose // unsaved notes on exit... Stdlib.signal(Signum.SIGTERM, OnExitSignal); Stdlib.signal(Signum.SIGINT, OnExitSignal); }
public MeshworkDaemon(string fileName) { LogItem("MESHWORK DAEMON CLIENT 0.1"); FileFind.Common.SetProcessName("meshwork-daemon"); Stdlib.signal(Signum.SIGINT, handle_signal); Stdlib.signal(Signum.SIGKILL, handle_signal); settings = Settings.ReadSettings(fileName); Core.Init(settings); Core.AvatarManager = new AvatarManager(); Core.NetworkAdded += AddNetworkEvents; Core.LoggingService.AddLogger(this); Core.Start(); }
public void SubscribeToUnixSignals() { var handler = new SignalHandler(UnixSignalHandler); #pragma warning disable 612,618 Stdlib.signal(Signum.SIGTERM, handler); Stdlib.signal(Signum.SIGINT, handler); Stdlib.signal(Signum.SIGHUP, handler); Stdlib.signal(Signum.SIGKILL, handler); Stdlib.signal(Signum.SIGTSTP, handler); Stdlib.signal(Signum.SIGSEGV, handler); Stdlib.signal(Signum.SIGFPE, handler); Stdlib.signal(Signum.SIGABRT, handler); Stdlib.signal(Signum.SIGILL, handler); Stdlib.signal(Signum.SIGSTOP, handler); Stdlib.signal(Signum.SIGQUIT, handler); #pragma warning restore 612,618 }