/// <summary> /// Reuses the specified pipeline. /// </summary> /// <param name="application">The application.</param> internal void Reuse(SnmpApplication application) { lock (_root) { _queue.Enqueue(application); } }
/// <summary> /// Creates a pipeline for the specified context. /// </summary> /// <param name="context">The context.</param> /// <returns></returns> public SnmpApplication Create(ISnmpContext context) { SnmpApplication result = new SnmpApplication(this, _logger, _store, _membershipProvider, _factory); result.Init(context); return(result); }
private void ListenerMessageReceived(object sender, MessageReceivedEventArgs e) { ISnmpMessage request = e.Message; SnmpContext context = SnmpContextFactory.Create(request, e.Sender, Listener.Users, _group, e.Binding); SnmpApplication application = _factory.Create(context); application.Process(); }
/// <summary> /// Creates a pipeline for the specified context. /// </summary> /// <param name="context">The context.</param> /// <returns></returns> public SnmpApplication Create(ISnmpContext context) { SnmpApplication result = null; lock (_root) { if (_queue.Count > 0) { result = _queue.Dequeue(); } } if (result == null) { result = new SnmpApplication(this, _logger, _store, _membershipProvider, _factory); } result.Init(context); return result; }
/// <summary> /// Creates a pipeline for the specified context. /// </summary> /// <param name="context">The context.</param> /// <returns></returns> public SnmpApplication Create(ISnmpContext context) { SnmpApplication result = null; lock (_root) { if (_queue.Count > 0) { result = _queue.Dequeue(); } } if (result == null) { result = new SnmpApplication(this, _logger, _store, _membershipProvider, _factory); } result.Init(context); return(result); }