Example #1
0
 public void PingInterval(uint pingInterval) => LibENet.PeerPingInterval(Unsafe, pingInterval);
Example #2
0
        /// <summary>
        /// Sets the interval at which pings will be sent to the peer.
        /// </summary>
        /// <param name="timeout">The interval at which to send pings; defaults to ENET_PEER_PING_INTERVAL if <see cref="TimeSpan.Zero"/></param>
        /// <remarks>
        /// From offical doc:
        /// Pings are used both to monitor the liveness of the connection and also to dynamically adjust the throttle during
        /// periods of low traffic so that the throttle has reasonable responsiveness during traffic spikes.
        /// </remarks>
        public void PingInterval(TimeSpan timeout)
        {
            ThrowIfNull();

            LibENet.PeerPingInterval(m_Native, (uint)timeout.TotalMilliseconds);
        }