1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-15 06:36:30 +09:00

Handshakes are now resent if lost. Documentation updated.

This commit is contained in:
lidgren
2010-12-25 09:51:49 +00:00
parent cb887dd4b5
commit b83ec10d8d
5 changed files with 96 additions and 14 deletions

View File

@@ -44,6 +44,8 @@ namespace Lidgren.Network
internal int m_port;
internal int m_receiveBufferSize;
internal int m_sendBufferSize;
internal float m_resendHandshakeInterval;
internal int m_maximumHandshakeAttempts;
// bad network simulation
internal float m_loss;
@@ -79,6 +81,8 @@ namespace Lidgren.Network
m_pingInterval = 4.0f;
m_connectionTimeout = 25.0f;
m_useMessageRecycling = true;
m_resendHandshakeInterval = 3.0f;
m_maximumHandshakeAttempts = 5;
// Maximum transmission unit
// Ethernet can take 1500 bytes of payload, so lets stay below that.
@@ -302,6 +306,24 @@ namespace Lidgren.Network
set { m_acceptIncomingConnections = value; }
}
/// <summary>
/// Gets or sets the number of seconds between handshake attempts
/// </summary>
public float ResendHandshakeInterval
{
get { return m_resendHandshakeInterval; }
set { m_resendHandshakeInterval = value; }
}
/// <summary>
/// Gets or sets the maximum number of handshake attempts before failing to connect
/// </summary>
public int MaximumHandshakeAttempts
{
get { return m_maximumHandshakeAttempts; }
set { m_maximumHandshakeAttempts = value; }
}
/// <summary>
/// Gets or sets if the NetPeer should send large messages to try to expand the maximum transmission unit size
/// </summary>