// Copyright Epic Games, Inc. All Rights Reserved.
// This file is automatically generated. Changes to this file may be overwritten.
namespace Epic.OnlineServices.P2P
{
///
/// Structure containing information about new port range settings.
///
public struct SetPortRangeOptions
{
///
/// The ideal port to use for P2P traffic. The default value is 7777. If set to 0, the OS will choose a port. If set to 0, MaxAdditionalPortsToTry must be set to 0.
///
public ushort Port { get; set; }
///
/// The maximum amount of additional ports to try if Port is unavailable. Ports will be tried from Port to Port + MaxAdditionalPortsToTry
/// inclusive, until one is available or we run out of ports. If no ports are available, P2P connections will fail. The default value is 99.
///
public ushort MaxAdditionalPortsToTry { get; set; }
}
[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 8)]
internal struct SetPortRangeOptionsInternal : ISettable, System.IDisposable
{
private int m_ApiVersion;
private ushort m_Port;
private ushort m_MaxAdditionalPortsToTry;
public ushort Port
{
set
{
m_Port = value;
}
}
public ushort MaxAdditionalPortsToTry
{
set
{
m_MaxAdditionalPortsToTry = value;
}
}
public void Set(ref SetPortRangeOptions other)
{
m_ApiVersion = P2PInterface.SetportrangeApiLatest;
Port = other.Port;
MaxAdditionalPortsToTry = other.MaxAdditionalPortsToTry;
}
public void Set(ref SetPortRangeOptions? other)
{
if (other.HasValue)
{
m_ApiVersion = P2PInterface.SetportrangeApiLatest;
Port = other.Value.Port;
MaxAdditionalPortsToTry = other.Value.MaxAdditionalPortsToTry;
}
}
public void Dispose()
{
}
}
}