enet.peer:disconnect

enet.peer:disconnect Requests a disconnection from the peer. The message is sent on the next host:service() or host:flush(). Function Synopsis peer:disconnect(data) Arguments number data An optional integer value to be associated with the disconnect. Returns Nothing. See Also lua-enet enet.host enet.host:flush enet.host:service enet.peer

enet.peer:disconnect later

enet.peer:disconnect later Request a disconnection from peer, but only after all queued outgoing packets are sent. Function Synopsis peer:disconnect_later(data) Arguments number data Optional integer value to be associated with the disconnect. Returns Nothing. See Also lua-enet enet.peer

enet.peer:disconnect now

enet.peer:disconnect now Force immediate disconnection from peer. Foreign peer not guaranteed to receive disconnect notification. Function Synopsis peer:disconnect_now(data) Arguments number data Optional integer value to be associated with the disconnect. Returns Nothing. See Also lua-enet enet.peer

enet.peer:index

enet.peer:index Returns the index of the peer. All peers of an ENet host are kept in an array. This function finds and returns the index of the peer of its host structure. Function Synopsis peer:index() Arguments None. Returns number index The index of the peer. See Also lua-enet enet.peer enet.host

enet.peer:last round trip time

enet.peer:last round trip time Returns or sets the round trip time of the previous round trip time computation. If value is nil the current value of the peer is returned. Otherwise the the previous round trip time computation is set to the specified value and returned. ENet performs some filtering on the round trip times and it takes some time until the parameters are accurate. To speed it up you can set the value of the last round trip time to a more accurate guess. Function Synopsis peer:l

enet.peer:ping

enet.peer:ping Send a ping request to peer, updates round_trip_time. This is called automatically at regular intervals. Function Synopsis peer:ping() Arguments None. Returns Nothing. See Also lua-enet enet.peer enet.peer:round_trip_time

enet.peer:ping interval

enet.peer:ping interval Specifies the interval in milliseconds that pings are sent to the other end of the connection (defaults to 500). Function Synopsis peer:ping_interval(interval) Arguments number interval Time in milliseconds to wait before automatically calling peer:ping(). Returns Nothing. See Also lua-enet enet.peer enet.peer:ping

enet.peer:receive

enet.peer:receive Attempts to dequeue an incoming packet for this peer. Returns nil if there are no packets waiting. Otherwise returns two values: The string representing the packet data, and the channel the packet came from. Function Synopsis peer:receive() Arguments None. Returns string data Data from the received packet in a string. number channel Channel the packet was received from. See Also lua-enet enet.peer

enet.peer:reset

enet.peer:reset Forcefully disconnects peer. The peer is not notified of the disconnection. Function Synopsis peer:reset() Arguments None. Returns Nothing. See Also lua-enet enet.peer

enet.peer:round trip time

enet.peer:round trip time Returns or sets the current round trip time (i.e. ping). If value is nil the current value of the peer is returned. Otherwise the round trip time is set to the specified value and returned. ENet performs some filtering on the round trip times and it takes some time until the parameters are accurate. To speed it up, set the last round trip time to an accurate guess. Function Synopsis peer:round_trip_time() Arguments None. Returns number roundtriptime The peer's c