summaryrefslogtreecommitdiff
path: root/examples/v1arch
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2016-03-12 10:47:48 +0100
committerIlya Etingof <etingof@gmail.com>2016-03-12 10:47:48 +0100
commitd524518183dd023915324f0ed2b666a61bc0d39f (patch)
tree64f5222d88c4689589c31d30c118bb17108a28af /examples/v1arch
parent6f0ba0a5fc6b4db5e6a8d6f3eb1442b4d340017c (diff)
downloadpysnmp-git-d524518183dd023915324f0ed2b666a61bc0d39f.tar.gz
highlighing fixes
Diffstat (limited to 'examples/v1arch')
-rw-r--r--examples/v1arch/asyncore/agent/ntforg/send-inform-over-ipv4-and-ipv6.py20
1 files changed, 10 insertions, 10 deletions
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()