/// <summary> /// Invokes the message received event handler. /// </summary> /// <param name="e">The <see cref="Lextm.SharpSnmpLib.Messaging.MessageReceivedEventArgs"/> instance containing the event data.</param> public void InvokeMessageReceived(MessageReceivedEventArgs<InformRequestMessage> e) { EventHandler<MessageReceivedEventArgs<InformRequestMessage>> handler = MessageReceived; if (handler != null) { handler(this, e); } }
/// <summary> /// Invokes the message received event handler. /// </summary> /// <param name="e">The <see cref="Lextm.SharpSnmpLib.Messaging.MessageReceivedEventArgs"/> instance containing the event data.</param> public void InvokeMessageReceived(MessageReceivedEventArgs<TrapV1Message> e) { EventHandler<MessageReceivedEventArgs<TrapV1Message>> handler = MessageReceived; if (handler == null) { return; } handler(this, e); }
private void ListenerMessageReceived(object sender, MessageReceivedEventArgs e) { #if DEBUG var watch = new Stopwatch(); watch.Start(); #endif var request = e.Message; var context = SnmpContextFactory.Create(request, e.Sender, Listener.Users, _group, e.Binding); var application = _factory.Create(context); application.Process(); #if DEBUG watch.Stop(); Console.WriteLine("agent: {0}", watch.Elapsed); #endif }
private void ListenerMessageReceived(object sender, MessageReceivedEventArgs e) { var request = e.Message; var context = SnmpContextFactory.Create(request, e.Sender, Listener.Users, _group, e.Binding); var application = _factory.Create(context); application.Process(); }
private void ListenerTrapV1Received(object sender, MessageReceivedEventArgs<TrapV1Message> e) { LogMessage(string.Format(CultureInfo.InvariantCulture, StrSends, DateTime.Now, e.Sender, e.Message.ToString(Objects))); }
private static void WatcherTrapV1Received(object sender, MessageReceivedEventArgs<TrapV1Message> e) { Console.WriteLine(e.Message); }
private static void WatcherInformRequestReceived(object sender, MessageReceivedEventArgs<InformRequestMessage> e) { Console.WriteLine(e.Message); }