Skip to content

Class Lidgren::Network::NetPeerConfiguration

ClassList > Lidgren > Network > NetPeerConfiguration

Partly immutable after NetPeer has been initialized.

Public Static Attributes

Type Name
const int kDefaultMTU = = 1408
Default MTU value in bytes.

Public Properties

Type Name
property bool AcceptIncomingConnections
Gets or sets if the NetPeer should accept incoming connections. This is automatically set to true in NetServer and false in NetClient.
property string AppIdentifier
Gets the identifier of this application; the library can only connect to matching app identifier peers.
property bool AutoExpandMTU
Gets or sets if the NetPeer should send large messages to try to expand the maximum transmission unit size.
property bool AutoFlushSendQueue
Enables or disables automatic flushing of the send queue. If disabled, you must manully call NetPeer.FlushSendQueue() to flush sent messages to network.
property IPAddress BroadcastAddress
Gets or sets the local broadcast address to use when broadcasting.
property float ConnectionTimeout
Gets or sets the number of seconds timeout will be postponed on a successful ping/pong.
property int DefaultOutgoingMessageCapacity
Gets or sets the default capacity in bytes when NetPeer.CreateMessage() is called without argument.
property bool EnableUPnP
Enables UPnP support; enabling port forwarding and getting external ip.
property int ExpandMTUFailAttempts
Gets or sets the number of failed expand mtu attempts to perform before setting final MTU.
property float ExpandMTUFrequency
Gets or sets how often to send large messages to expand MTU if AutoExpandMTU is enabled.
property IPAddress LocalAddress
Gets or sets the local ip address to bind to. Defaults to IPAddress.Any. Cannot be changed once NetPeer is initialized.
property int MaximumConnections
Gets or sets the maximum amount of connections this peer can hold. Cannot be changed once NetPeer is initialized.
property int MaximumHandshakeAttempts
Gets or sets the maximum number of handshake attempts before failing to connect.
property int MaximumTransmissionUnit
Gets or sets the maximum amount of bytes to send in a single packet, excluding ip, udp and lidgren headers. Cannot be changed once NetPeer is initialized.
property string NetworkThreadName
Gets or sets the name of the library network thread. Cannot be changed once NetPeer is initialized.
property float PingInterval
Gets or sets the time between latency calculating pings.
property int Port
Gets or sets the local port to bind to. Defaults to 0. Cannot be changed once NetPeer is initialized.
property int ReceiveBufferSize
Gets or sets the size in bytes of the receiving buffer. Defaults to 131071 bytes. Cannot be changed once NetPeer is initialized.
property int RecycledCacheMaxCount
Gets or sets the maximum number of incoming/outgoing messages to keep in the recycle cache.
property float ResendHandshakeInterval
Gets or sets the number of seconds between handshake attempts.
property int SendBufferSize
Gets or sets the size in bytes of the sending buffer. Defaults to 131071 bytes. Cannot be changed once NetPeer is initialized.
property bool SuppressUnreliableUnorderedAcks
If true, will not send acks for unreliable unordered messages. This will save bandwidth, but disable flow control and duplicate detection for this type of messages.
property NetUnreliableSizeBehaviour UnreliableSizeBehaviour
Gets or sets the behaviour of unreliable sends above MTU.
property bool UseMessageRecycling
Gets or sets if the library should recycling messages to avoid excessive garbage collection. Cannot be changed once NetPeer is initialized.

Public Functions

Type Name
NetPeerConfiguration Clone ()
Creates a memberwise shallow clone of this configuration.
void DisableMessageType (NetIncomingMessageType type)
Disables receiving of the specified type of message.
void EnableMessageType (NetIncomingMessageType type)
Enables receiving of the specified type of message.
bool IsMessageTypeEnabled (NetIncomingMessageType type)
Gets if receiving of the specified type of message is enabled.
NetPeerConfiguration (string appIdentifier)
NetPeerConfiguration constructor.
void SetMessageTypeEnabled (NetIncomingMessageType type, bool enabled)
Enables or disables receiving of the specified type of message.

Public Static Attributes Documentation

variable kDefaultMTU

const int Lidgren.Network.NetPeerConfiguration.kDefaultMTU;

Public Properties Documentation

property AcceptIncomingConnections

bool Lidgren.Network.NetPeerConfiguration.AcceptIncomingConnections;

property AppIdentifier

string Lidgren.Network.NetPeerConfiguration.AppIdentifier;

property AutoExpandMTU

bool Lidgren.Network.NetPeerConfiguration.AutoExpandMTU;

property AutoFlushSendQueue

bool Lidgren.Network.NetPeerConfiguration.AutoFlushSendQueue;

property BroadcastAddress

IPAddress Lidgren.Network.NetPeerConfiguration.BroadcastAddress;

property ConnectionTimeout

float Lidgren.Network.NetPeerConfiguration.ConnectionTimeout;

property DefaultOutgoingMessageCapacity

int Lidgren.Network.NetPeerConfiguration.DefaultOutgoingMessageCapacity;

property EnableUPnP

bool Lidgren.Network.NetPeerConfiguration.EnableUPnP;

property ExpandMTUFailAttempts

int Lidgren.Network.NetPeerConfiguration.ExpandMTUFailAttempts;

property ExpandMTUFrequency

float Lidgren.Network.NetPeerConfiguration.ExpandMTUFrequency;

property LocalAddress

IPAddress Lidgren.Network.NetPeerConfiguration.LocalAddress;

property MaximumConnections

int Lidgren.Network.NetPeerConfiguration.MaximumConnections;

property MaximumHandshakeAttempts

int Lidgren.Network.NetPeerConfiguration.MaximumHandshakeAttempts;

property MaximumTransmissionUnit

int Lidgren.Network.NetPeerConfiguration.MaximumTransmissionUnit;

property NetworkThreadName

string Lidgren.Network.NetPeerConfiguration.NetworkThreadName;

property PingInterval

float Lidgren.Network.NetPeerConfiguration.PingInterval;

property Port

int Lidgren.Network.NetPeerConfiguration.Port;

property ReceiveBufferSize

int Lidgren.Network.NetPeerConfiguration.ReceiveBufferSize;

property RecycledCacheMaxCount

int Lidgren.Network.NetPeerConfiguration.RecycledCacheMaxCount;

property ResendHandshakeInterval

float Lidgren.Network.NetPeerConfiguration.ResendHandshakeInterval;

property SendBufferSize

int Lidgren.Network.NetPeerConfiguration.SendBufferSize;

property SuppressUnreliableUnorderedAcks

bool Lidgren.Network.NetPeerConfiguration.SuppressUnreliableUnorderedAcks;

property UnreliableSizeBehaviour

NetUnreliableSizeBehaviour Lidgren.Network.NetPeerConfiguration.UnreliableSizeBehaviour;

property UseMessageRecycling

bool Lidgren.Network.NetPeerConfiguration.UseMessageRecycling;

Public Functions Documentation

function Clone

inline NetPeerConfiguration Lidgren::Network::NetPeerConfiguration::Clone () 

function DisableMessageType

inline void Lidgren::Network::NetPeerConfiguration::DisableMessageType (
    NetIncomingMessageType type
) 

function EnableMessageType

inline void Lidgren::Network::NetPeerConfiguration::EnableMessageType (
    NetIncomingMessageType type
) 

function IsMessageTypeEnabled

inline bool Lidgren::Network::NetPeerConfiguration::IsMessageTypeEnabled (
    NetIncomingMessageType type
) 

function NetPeerConfiguration

inline Lidgren::Network::NetPeerConfiguration::NetPeerConfiguration (
    string appIdentifier
) 

function SetMessageTypeEnabled

inline void Lidgren::Network::NetPeerConfiguration::SetMessageTypeEnabled (
    NetIncomingMessageType type,
    bool enabled
) 

The documentation for this class was generated from the following file api/unity-plugin/Scripts/Networking/Lidgren.Network/NetPeerConfiguration.cs