enet.host:get peer

Returns the connected peer at the specified index (starting at 1). ENet stores all peers in an array of the corresponding host and re-uses unused peers for new connections. You can query the state of a peer using peer:state().

Function

Synopsis

host:get_peer(index)

Arguments

number index
The index of the desired peer.

Returns

enet.peer peer
The desired peer structure.

See Also

Other Languages