EnetEvent¶
from acron.enet import EnetEvent
- class EnetEvent¶
Bases:
Bases:
ReferenceCountA single event returned by EnetHost::service(): a new connection, a disconnection, or a received packet. For T_receive events the packet payload is copied into the event and the underlying ENet packet is released immediately, so events may be kept around freely.
Inheritance diagram
digraph inheritance6c8d987a85 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "EnetEvent" [URL="acron.enet.EnetEvent.html#acron.enet.EnetEvent",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "ReferenceCount" -> "EnetEvent" [arrowsize=0.75,style=""]; "ReferenceCount" [URL="acron.core.ReferenceCount.html#acron.core.ReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "ReferenceCount" [arrowsize=0.75,style=""]; }-
enum Type
Mirrors ENET_EVENT_TYPE_*.
-
enumerator T_none = 0
-
enumerator T_connect = 1¶
-
enumerator T_disconnect = 2¶
-
enumerator T_receive = 3¶
-
enumerator T_none = 0
- __init__()¶
- property channel uint8_t¶
- property data bytes¶
The payload of a T_receive event. Maps to bytes in Python.
The payload of a T_receive event. Maps to bytes in Python.
The payload of a T_receive event. Maps to bytes in Python.
- property event_data int¶
The user-supplied data field: for T_connect this is the value passed to connect(), for T_disconnect the value passed to disconnect().
The user-supplied data field: for T_connect this is the value passed to connect(), for T_disconnect the value passed to disconnect().
The user-supplied data field: for T_connect this is the value passed to connect(), for T_disconnect the value passed to disconnect().
- get_channel()¶
- get_data()¶
The payload of a T_receive event. Maps to bytes in Python.
The payload of a T_receive event. Maps to bytes in Python.
- get_datagram()¶
The payload wrapped in a Datagram, for use with
DatagramIterator. Note that, as with any Datagram, you must keep it alive (e.g. assigned to a variable) for as long as aDatagramIteratoris reading from it.Returns the payload of a T_receive event wrapped in a Datagram, ready to be read with a
DatagramIterator.
- get_event_data()¶
The user-supplied data field: for T_connect this is the value passed to connect(), for T_disconnect the value passed to disconnect().
The user-supplied data field: for T_connect this is the value passed to connect(), for T_disconnect the value passed to disconnect().
- get_packet_flags()¶
The ENet packet flags of a received packet (see
EnetPeer::PacketFlag).The ENet packet flags of a received packet (see
EnetPeer::PacketFlag).
- get_peer()¶
- get_type()¶
- output()¶
- property packet_flags int¶
The ENet packet flags of a received packet (see
EnetPeer::PacketFlag).The ENet packet flags of a received packet (see
EnetPeer::PacketFlag).The ENet packet flags of a received packet (see
EnetPeer::PacketFlag).
- property type Type¶
-
enum Type