== Description ==
An [[enet.event | event]] is a table generated by [[enet.host:service | host:service()]] or [[enet.peer:receive | peer:receive()]] which will '''always''' contain a [[string]] named ''type'', a [[enet.peer]] named ''peer'', and a [[string]] or [[number]] named ''data'' depending on the kind of event.

Though be wary that [[enet.host:service | host:service()]] and [[enet.peer:receive | peer:receive()]] can return [[nil]] if no events are in the queue.

== Structure ==
{| class="wikitable"
!event.type
!event.peer
!event.data
|-
|"receive"
|[[enet.peer | peer]]
|[[string]]
|-
|"disconnect"
|[[enet.peer | peer]]
|[[number]]
|-
|"connect"
|[[enet.peer | peer]]
|[[number]]
|}

== See Also ==
* [[parent::lua-enet]]
* [[enet.host:service]]
* [[enet.peer:receive]]

== Other Languages ==
{{i18n|enet.event}}