diff options
author | elie <elie> | 2013-06-01 12:15:58 +0000 |
---|---|---|
committer | elie <elie> | 2013-06-01 12:15:58 +0000 |
commit | 374652248999709006e9deb62fe2d8f3cdb6323d (patch) | |
tree | e9933e8a618a0b3d0e5b0cb2000a8184fabbef9e /examples/v3arch/twisted/manager/ntfrcv | |
parent | a8bd7e3f06c5c84363764de284ef4e7024534969 (diff) | |
download | pysnmp-374652248999709006e9deb62fe2d8f3cdb6323d.tar.gz |
config.addSocketTransport() helper renamed into config.addTransport()
and improved by automatically instantiating compatible TransportDispatcher
making it dispatcher-agnostic. As an additional bonus, application may not
call registerTransportDispatcher() as it would be called by addTransport().
Diffstat (limited to 'examples/v3arch/twisted/manager/ntfrcv')
-rw-r--r-- | examples/v3arch/twisted/manager/ntfrcv/v2c-multiple-interfaces.py | 8 | ||||
-rw-r--r-- | examples/v3arch/twisted/manager/ntfrcv/v3-multiple-users.py | 6 |
2 files changed, 3 insertions, 11 deletions
diff --git a/examples/v3arch/twisted/manager/ntfrcv/v2c-multiple-interfaces.py b/examples/v3arch/twisted/manager/ntfrcv/v2c-multiple-interfaces.py index 576ee1f..f0edca7 100644 --- a/examples/v3arch/twisted/manager/ntfrcv/v2c-multiple-interfaces.py +++ b/examples/v3arch/twisted/manager/ntfrcv/v2c-multiple-interfaces.py @@ -18,7 +18,6 @@ # from twisted.internet import reactor from pysnmp.entity import engine, config -from pysnmp.carrier.twisted import dispatch from pysnmp.carrier.twisted.dgram import udp from pysnmp.entity.rfc3413 import ntfrcv @@ -28,18 +27,15 @@ snmpEngine = engine.SnmpEngine() # Transport setup -# Instantiate and register Twisted dispatcher at SNMP engine -snmpEngine.registerTransportDispatcher(dispatch.TwistedDispatcher()) - # UDP over IPv4, first listening interface/port -config.addSocketTransport( +config.addTransport( snmpEngine, udp.domainName + (1,), udp.UdpTwistedTransport().openServerMode(('127.0.0.1', 162)) ) # UDP over IPv4, second listening interface/port -config.addSocketTransport( +config.addTransport( snmpEngine, udp.domainName + (2,), udp.UdpTwistedTransport().openServerMode(('127.0.0.1', 2162)) diff --git a/examples/v3arch/twisted/manager/ntfrcv/v3-multiple-users.py b/examples/v3arch/twisted/manager/ntfrcv/v3-multiple-users.py index 544eb89..6421672 100644 --- a/examples/v3arch/twisted/manager/ntfrcv/v3-multiple-users.py +++ b/examples/v3arch/twisted/manager/ntfrcv/v3-multiple-users.py @@ -21,7 +21,6 @@ # from twisted.internet import reactor from pysnmp.entity import engine, config -from pysnmp.carrier.twisted import dispatch from pysnmp.carrier.twisted.dgram import udp from pysnmp.entity.rfc3413 import ntfrcv from pysnmp.proto import rfc1902 @@ -32,11 +31,8 @@ snmpEngine = engine.SnmpEngine() # Transport setup -# Instantiate and register Twisted dispatcher at SNMP engine -snmpEngine.registerTransportDispatcher(dispatch.TwistedDispatcher()) - # UDP over IPv4 -config.addSocketTransport( +config.addTransport( snmpEngine, udp.domainName, udp.UdpTwistedTransport().openServerMode(('127.0.0.1', 162)) |