diff options
Diffstat (limited to 'pysnmp/carrier/asyncio/dgram/udp6.py')
-rw-r--r-- | pysnmp/carrier/asyncio/dgram/udp6.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pysnmp/carrier/asyncio/dgram/udp6.py b/pysnmp/carrier/asyncio/dgram/udp6.py index ad3c28dd..290c03bd 100644 --- a/pysnmp/carrier/asyncio/dgram/udp6.py +++ b/pysnmp/carrier/asyncio/dgram/udp6.py @@ -7,6 +7,7 @@ import socket from pysnmp.carrier.base import AbstractTransportAddress from pysnmp.carrier.asyncio.dgram.base import DgramAsyncioProtocol + try: import asyncio except ImportError: @@ -16,9 +17,11 @@ loop = asyncio.get_event_loop() domainName = snmpUDP6Domain = (1, 3, 6, 1, 2, 1, 100, 1, 2) + class Udp6TransportAddress(tuple, AbstractTransportAddress): pass + class Udp6AsyncioTransport(DgramAsyncioProtocol): sockFamily = socket.has_ipv6 and socket.AF_INET6 or None addressType = Udp6TransportAddress @@ -28,9 +31,10 @@ class Udp6AsyncioTransport(DgramAsyncioProtocol): return self.addressType((transportAddress[0].split('%')[0], transportAddress[1], 0, # flowinfo - 0)) # scopeid + 0)) # scopeid else: return self.addressType((transportAddress[0], transportAddress[1], 0, 0)) + Udp6Transport = Udp6AsyncioTransport |