[snmp] SnmpContext question

Birgit Arkesteijn birgit at westhawk.co.uk
Thu Aug 23 12:16:32 BST 2007


Hi Brian,

It depends a bit on your needs whether to go via a SnmpContext or use 
ListeningContextPool straight away. If you want the stack to decode your 
trap, you need a SnmpContext and add a listener to it. If you want to 
handle all incoming (undecoded or raw) traps yourself, you use the later 
class.

There is a section in the StackUsage document (StackUsage.html) that 
explains how to listen for incoming traps. The document is part of the 
distribution zip. Hopefully it answers most of your questions below.

We've had questions before in the mailing list regarding decoding traps. 
The google search box in page http://snmp.westhawk.co.uk/index.html 
should help you find them.

Cheers, Birgit


On 22/08/07 19:07, Brian Jewell wrote:
> Birgit,
> 
> A couple more questions regarding Contexts vs. Context Pools...
> 
> In an application that listens for SNMP traps, I'm trying to understand the
> difference between instantiating individual Contexts (i.e., "new
> SnmpContextv2c()") as opposed to using the Context Pool.
> 
> Does using the ListeningContextPool relieve me of the overhead of keeping
> track of the contexts that are created? 
> 
> In other words, if I want to create a context to listen for traps, and later
> I want to "turn off" trap listening by calling removeTrapListener(), does
> using ListeningContextPool somehow associate the context that was created
> with the instance of the class that created it?
> 
> Both approaches ("new SnmpContextv2c()" and "new ListeningContextPool()")
> seemed to be used in the sample ReceiveTrap.java, so I'm a little confused
> about which approach is best.
> 
> Thanks again for your help.
> 
> --Brian


-- 
-- Birgit Arkesteijn, birgit at westhawk.co.uk,
-- Westhawk Ltd, Albion Wharf, 19 Albion Street, Manchester M1 5LN, UK
-- Company no: 1769350
-- Registered Office:
-- 15 London Road, Stockton Heath, Warrington WA4 6SJ. UK.
-- tel.: +44 (0)161 237 0660
-- <URL: http://www.westhawk.co.uk>


More information about the snmp mailing list