pysnmp icon indicating copy to clipboard operation
pysnmp copied to clipboard

DNS oversight in asyncio examples

Open sonicisthebest opened this issue 9 years ago • 2 comments

Hi. Neat library.

Just testing things out using asyncio and I noticed some blocking code in the asyncio examples. It seems that UdpTransportTarget((host, port)) is calling to resolve DNS in a blocking manor, which causes delay on the asyncio event loop.

Looks like the asyncio version may need a coroutine based DNS resolution. Perhaps using https://docs.python.org/3.5/library/asyncio-eventloop.html#asyncio.AbstractEventLoop.getaddrinfo

sonicisthebest avatar Dec 13 '16 17:12 sonicisthebest

Indeed! I will fix that eventually. Unless you come up with a PR before. ;)

etingof avatar Dec 18 '16 10:12 etingof

Fixed and will ship in the next 7.0.x release.

lextm avatar Aug 26 '24 08:08 lextm