Legacy Documentation: Version 5.4
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

NetworkTransport.ConnectAsNetworkHost

public static void ConnectAsNetworkHost(int hostId, string address, int port, Networking.Types.NetworkID network, Networking.Types.SourceID source, Networking.Types.NodeID node, out byte error);

Parameters

hostId Id of udp socket used to establish connection.
address Ip4.
port Port.
network Guid of Relay network.
source Guid of user.
error Possible error (NetworkError.Ok if success).
node Slot id for this user.

Description

Create dedicated connection to Relay server.

Client calls this function to set itself as an owner of the network group on the Relay server. This client should call ReceiveRelayEventFromHost periodically to be notified about connection/disconnection events to/from Relay server.