namespace Unity.Networking.Transport
{
///
/// The interface for NetworkParameters
///
public interface INetworkParameter
{
}
///
/// Default NetworkParameter Constants.
///
public struct NetworkParameterConstants
{
/// The default size of the event queue.
public const int InitialEventQueueSize = 100;
public const int InvalidConnectionId = -1;
///
/// The default size of the DataStreamWriter. This value can be overridden using the .
///
public const int DriverDataStreamSize = 64 * 1024;
/// The default connection timeout value. This value can be overridden using the
public const int ConnectTimeoutMS = 1000;
/// The default max connection attempts value. This value can be overridden using the
public const int MaxConnectAttempts = 60;
/// The default disconnect timeout attempts value. This value can be overridden using the
public const int DisconnectTimeoutMS = 30 * 1000;
public const int MTU = 1400;
}
///
/// The NetworkDataStreamParameter is used to set a fixed data stream size.
///
/// The will grow on demand if the size is set to zero.
public struct NetworkDataStreamParameter : INetworkParameter
{
/// Size of the default
public int size;
}
///
/// The NetworkConfigParameter is used to set specific parameters that the driver uses.
///
public struct NetworkConfigParameter : INetworkParameter
{
/// A timeout in milliseconds indicating how long we will wait until we send a new connection attempt.
public int connectTimeoutMS;
/// The maximum amount of connection attempts we will try before disconnecting.
public int maxConnectAttempts;
/// A timeout in milliseconds indicating how long we will wait for a socket event, before we disconnect the socket.
/// The connection needs to receive data from the connected endpoint within this timeout.
public int disconnectTimeoutMS;
/// The maximum amount of time a single frame can advance timeout values.
/// The main use for this parameter is to not get disconnects at frame spikes when both endpoints lives in the same process.
public int maxFrameTimeMS;
/// A fixed amount of time to use for an interval between ScheduleUpdate. This is used instead of a clock.
/// The main use for this parameter is tests where determinism is more important than correctness.
public int fixedFrameTimeMS;
}
}