v1.0.0
Latest
2022.3+

Class NetworkConfiguration

Configuration data for network handlers.

Inheritance
System.Object
NetworkConfiguration
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Unity.Services.Multiplayer
Syntax
public class NetworkConfiguration
Remarks

Used in StartAsync(NetworkConfiguration).

Properties

DirectNetworkListenAddress

Endpoint (IP address and port) to listen on.

Declaration
public NetworkEndpoint DirectNetworkListenAddress { get; }
Property Value
TypeDescription
NetworkEndpoint
Remarks

May differ from DirectNetworkPublishAddress but the ports must match. Only available when NetworkType is Direct.

DirectNetworkPublishAddress

Endpoint (IP address and port) to be used by connecting clients.

Declaration
public NetworkEndpoint DirectNetworkPublishAddress { get; }
Property Value
TypeDescription
NetworkEndpoint
Remarks

May differ from DirectNetworkListenAddress but the ports must match. Only available when NetworkType is Direct.

RelayClientData

Relay configuration data for a client.

Declaration
public RelayServerData RelayClientData { get; }
Property Value
TypeDescription
RelayServerData
Remarks

Not available when NetworkType is Direct.

RelayServerData

Relay configuration data for a host or server.

Declaration
public RelayServerData RelayServerData { get; }
Property Value
TypeDescription
RelayServerData
Remarks

Not available when NetworkType is Direct. Not available when Role is Client.

Role

Networking role for this session.

Declaration
public NetworkRole Role { get; }
Property Value
TypeDescription
NetworkRole
Remarks

Some flows, such as peer-to-peer matchmaking or Unity.Services.Multiplayer.SessionManager.CreateOrJoinAsync(System.String,Unity.Services.Multiplayer.SessionOptions), will randomly assign roles to players as being either a Client or a Host.

Type

The type of network to use for the session.

Declaration
public NetworkType Type { get; }
Property Value
TypeDescription
NetworkType

Methods

UpdatePublishPort(UInt16)

Update the port for clients to connect to that will be shared through the session.

Declaration
public void UpdatePublishPort(ushort port)
Parameters
TypeNameDescription
System.UInt16port

The port for clients to connect to