== Description ==
An ENet peer which data packets may be sent or received from. In most applications you'll manually keep track of connected peers.

== Functions ==
{| class="wikitable"
!Function
!Description
|-
|[[enet.peer:disconnect | peer:disconnect]]
|Requests a disconnection from the peer.
|-
|[[enet.peer:disconnect_now | peer:disconnect_now]]
|Force immediate disconnection from peer.
|-
|[[enet.peer:disconnect_later | peer:disconnect_later]]
|Request a disconnection from peer, but only after all queued outgoing packets are sent.
|-
|[[enet.peer:reset | peer:reset]]
|Forcefully disconnects peer. The peer is not notified of the disconnection.
|-
|[[enet.peer:ping | peer:ping]]
|Send a ping request to peer, updates [[enet.peer:round_trip_time | round_trip_time]]. This is called automatically at regular intervals.
|-
|[[enet.peer:receive | peer:receive]]
|Attempts to dequeue an incoming packet for this peer.
|-
|[[enet.peer:send | peer:send]]
|Queues a packet to be sent to peer.
|-
|[[enet.peer:throttle_configure | peer:throttle_configure]]
|Changes the probability at which unreliable packets should not be dropped.
|-
|[[enet.peer:ping_interval | peer:ping_interval]]
|Specifies the interval in milliseconds that pings are sent to the other end of the connection (defaults to 500).
|-
|[[enet.peer:timeout | peer:timeout]]
|Returns or sets the parameters when a timeout is detected.
|-
|[[enet.peer:index | peer:index]]
|Returns the index of the peer.
|-
|[[enet.peer:state | peer:state]]
|Returns the state of the peer.
|-
|[[enet.peer:connect_id | peer:connect_id]]
|Returns the field ENetPeer::connectID that is assigned for each connection.
|-
|[[enet.peer:round_trip_time | peer:round_trip_time]]
|Returns or sets the current round trip time (i.e. ping).
|-
|[[enet.peer:last_round_trip_time | peer:last_round_trip_time]]
|Returns or sets the round trip time of the previous round trip time computation.
|}

== See Also ==
* [[parent::lua-enet]]
* [[enet.event]]
* [[enet.host]]