Skip to content

Commit

Permalink
typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Koos85 committed Sep 18, 2024
1 parent aa11d1f commit 4aecb6f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions asyncsnmplib/trapserver.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import asyncio
import logging
from typing import Optional
from typing import Optional, Any
from .protocol import SnmpProtocol, Package
from .asn1 import Decoder
from .mib.mib_index import MIB_INDEX
Expand Down Expand Up @@ -46,7 +46,11 @@ def on_package(data):

class SnmpTrapProtocol(SnmpProtocol):

def datagram_received(self, data: bytes, *args):
def datagram_received(self, data: bytes, addr: Any):
# NOTE on typing
# https://docs.python.org/3/library/asyncio-protocol.html
# addr is the address of the peer sending the data;
# the exact format depends on the transport.
pkg = Package()
try:
pkg.decode(data)
Expand Down

0 comments on commit 4aecb6f

Please sign in to comment.