Esempio n. 1
0
 static void Main(string[] args)
 {
     System.Net.IPEndPoint ep = new System.Net.IPEndPoint(System.Net.IPAddress.Any, 4004);
     SyslogDaemon daemon = new SyslogDaemon(ep, Encoding.UTF8);
     IServerStatus istatus = (IServerStatus)daemon;
     ServerStatusLogger logger = new ServerStatusLogger(ref istatus, Encoding.UTF8);
     logger.LogEntryAdded += new EventHandler<Just.EventArguments.StringEventArgs>(logger_LogEntryAdded);
     daemon.StartReceiving();
     Console.Read();
 }
Esempio n. 2
0
File: Main.cs Progetto: dohjo/NTPR
 public Main(ISyslogDaemon daemon, bool logging)
 {
     InitializeComponent();
     this._SyslogDaemon = daemon;
     IServerStatus status = (IServerStatus)daemon;
     this._Logger = new ServerStatusLogger(ref status, Encoding.Default, true, logging, "syslog.txt");
     this._Logger.StatusChanged += new EventHandler<Just.EventArguments.StringEventArgs>(_Logger_StatusChanged);
     this._SyslogDaemon.SyslogMessageReceived += new EventHandler<Just.EventArguments.GenericEventArgs<SyslogProtocol>>(_SyslogDaemon_SyslogMessageReceived);
     this._SyslogDaemon.Start();
     this.FormClosed += new FormClosedEventHandler(Main_FormClosed);
 }