From d524518183dd023915324f0ed2b666a61bc0d39f Mon Sep 17 00:00:00 2001 From: Ilya Etingof Date: Sat, 12 Mar 2016 10:47:48 +0100 Subject: highlighing fixes --- .../agent/ntforg/send-inform-over-ipv4-and-ipv6.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'examples/v1arch') diff --git a/examples/v1arch/asyncore/agent/ntforg/send-inform-over-ipv4-and-ipv6.py b/examples/v1arch/asyncore/agent/ntforg/send-inform-over-ipv4-and-ipv6.py index 6e29c4c6..7221355d 100644 --- a/examples/v1arch/asyncore/agent/ntforg/send-inform-over-ipv4-and-ipv6.py +++ b/examples/v1arch/asyncore/agent/ntforg/send-inform-over-ipv4-and-ipv6.py @@ -20,7 +20,7 @@ The following Net-SNMP command will produce similar SNMP notification: from time import time from pysnmp.carrier.asynsock.dispatch import AsynsockDispatcher from pysnmp.carrier.asynsock.dgram import udp, udp6 -from pyasn1.codec.ber import encoder +from pyasn1.codec.ber import encoder, decoder from pysnmp.proto.api import v2c as pMod # Build PDU @@ -38,7 +38,7 @@ startedAt = time() def cbTimerFun(timeNow): if timeNow - startedAt > 3: raise Exception("Request timed out") - + def cbRecvFun(transportDispatcher, transportDomain, transportAddress, wholeMsg, reqPDU=reqPDU): while wholeMsg: @@ -56,7 +56,7 @@ def cbRecvFun(transportDispatcher, transportDomain, transportAddress, print('%s = %s' % (oid.prettyPrint(), val.prettyPrint())) transportDispatcher.jobFinished(1) return wholeMsg - + transportDispatcher = AsynsockDispatcher() transportDispatcher.registerRecvCbFun(cbRecvFun) @@ -72,13 +72,13 @@ transportDispatcher.sendMessage( transportDispatcher.jobStarted(1) # UDP/IPv6 -transportDispatcher.registerTransport( - udp6.domainName, udp6.Udp6SocketTransport().openClientMode() -) -transportDispatcher.sendMessage( - encoder.encode(trapMsg), udp6.domainName, ('::1', 162) -) -transportDispatcher.jobStarted(1) +#transportDispatcher.registerTransport( +# udp6.domainName, udp6.Udp6SocketTransport().openClientMode() +#) +#transportDispatcher.sendMessage( +# encoder.encode(trapMsg), udp6.domainName, ('::1', 162) +#) +#transportDispatcher.jobStarted(1) # Dispatcher will finish as all scheduled messages are sent transportDispatcher.runDispatcher() -- cgit v1.2.1