on_data_in Event
Fired when data is received.
Syntax
class UDPPortDataInEventParams(object): @property def datagram() -> bytes: ... @property def source_address() -> str: ... @property def source_port() -> int: ... # In class UDPPort: @property def on_data_in() -> Callable[[UDPPortDataInEventParams], None]: ... @on_data_in.setter def on_data_in(event_hook: Callable[[UDPPortDataInEventParams], None]) -> None: ...
Remarks
The on_data_in event is fired every time a new datagram is received.
Datagram contains the packet as sent by the remote host.
SourceAddress contains the IP number (Internet address) of the remote host, and SourcePort contains the port from which the packet originated.
Note that events are not re-entrant. Performing time consuming operations within this event will prevent it from firing again in a timely manner and may impact overall performance.