Class ConnectionExtensions
Provides extension methods on SessionOptions to configure connection options for sessions.
Inherited Members
Namespace: Unity.Services.Multiplayer
Assembly: Unity.Services.Multiplayer.dll
Syntax
public static class ConnectionExtensions
Methods
WithDirectConnection<T>(T, string, int?, string)
The extension method configures the SessionOptions to create a direct connection when the session is created using provided IP and Port.
Declaration
public static T WithDirectConnection<T>(this T options, string ip = null, int? port = null, string listenAddress = null) where T : SessionOptions
Parameters
Type | Name | Description |
---|---|---|
T | options | The SessionOptions this extension method applies to. |
string | ip | The IP address the netcode connection of the session will be connected to. |
int? | port | The port the netcode connection of the session will be connected to. |
string | listenAddress | As a host of a session, the address that will be used to listen to the incoming connection. |
Returns
Type | Description |
---|---|
T | SessionOptions |
Type Parameters
Name | Description |
---|---|
T |
WithRelayConnection<T>(T, string)
The extension method configures the SessionOptions to create a Relay connection within the provided region when the session is created.
Declaration
public static T WithRelayConnection<T>(this T options, string region = null) where T : SessionOptions
Parameters
Type | Name | Description |
---|---|---|
T | options | The SessionOptions this extension method applies to. |
string | region | The Relay region where the Relay allocation will happen. |
Returns
Type | Description |
---|---|
T | SessionOptions |
Type Parameters
Name | Description |
---|---|
T |