diff options
author | lsalzman <[email protected]> | 2012-05-29 19:05:34 -0700 |
---|---|---|
committer | lsalzman <[email protected]> | 2012-05-29 19:05:34 -0700 |
commit | ea8faf35798e94657af3da5bffe70841971a3995 (patch) | |
tree | f53281cf0d0e895410f9da5b5c525b858b35c997 /protocol.c | |
parent | fb55c5d7c3a293388932081e0d7b139a82193804 (diff) | |
download | enet-ea8faf35798e94657af3da5bffe70841971a3995.tar.gz enet-ea8faf35798e94657af3da5bffe70841971a3995.zip |
added per-peer configurable ping interval and timeouts
1.3.4 release prep
Diffstat (limited to 'protocol.c')
-rw-r--r-- | protocol.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1375,9 +1375,9 @@ enet_protocol_check_timeouts (ENetHost * host, ENetPeer * peer, ENetEvent * even peer -> earliestTimeout = outgoingCommand -> sentTime; if (peer -> earliestTimeout != 0 && - (ENET_TIME_DIFFERENCE (host -> serviceTime, peer -> earliestTimeout) >= ENET_PEER_TIMEOUT_MAXIMUM || + (ENET_TIME_DIFFERENCE (host -> serviceTime, peer -> earliestTimeout) >= peer -> timeoutMaximum || (outgoingCommand -> roundTripTimeout >= outgoingCommand -> roundTripTimeoutLimit && - ENET_TIME_DIFFERENCE (host -> serviceTime, peer -> earliestTimeout) >= ENET_PEER_TIMEOUT_MINIMUM))) + ENET_TIME_DIFFERENCE (host -> serviceTime, peer -> earliestTimeout) >= peer -> timeoutMinimum))) { enet_protocol_notify_disconnect (host, peer, event); @@ -1486,7 +1486,7 @@ enet_protocol_send_reliable_outgoing_commands (ENetHost * host, ENetPeer * peer) if (outgoingCommand -> roundTripTimeout == 0) { outgoingCommand -> roundTripTimeout = peer -> roundTripTime + 4 * peer -> roundTripTimeVariance; - outgoingCommand -> roundTripTimeoutLimit = ENET_PEER_TIMEOUT_LIMIT * outgoingCommand -> roundTripTimeout; + outgoingCommand -> roundTripTimeoutLimit = peer -> timeoutLimit * outgoingCommand -> roundTripTimeout; } if (enet_list_empty (& peer -> sentReliableCommands)) @@ -1572,7 +1572,7 @@ enet_protocol_send_outgoing_commands (ENetHost * host, ENetEvent * event, int ch if ((enet_list_empty (& currentPeer -> outgoingReliableCommands) || enet_protocol_send_reliable_outgoing_commands (host, currentPeer)) && enet_list_empty (& currentPeer -> sentReliableCommands) && - ENET_TIME_DIFFERENCE (host -> serviceTime, currentPeer -> lastReceiveTime) >= ENET_PEER_PING_INTERVAL && + ENET_TIME_DIFFERENCE (host -> serviceTime, currentPeer -> lastReceiveTime) >= currentPeer -> pingInterval && currentPeer -> mtu - host -> packetSize >= sizeof (ENetProtocolPing)) { enet_peer_ping (currentPeer); |