Class NetworkConnectionManager
The NGO connection manager handles:
- Client Connections
- Client Approval
- Processing Network
Event s. - Client Disconnection
Inherited Members
Namespace: Unity.Netcode
Assembly: Unity.Netcode.Runtime.dll
Syntax
public sealed class NetworkConnectionManager
Properties
DisconnectReason
When disconnected from the server, the server may send a reason. If a reason was sent, this property will tell client code what the reason was. It should be queried after the OnClientDisconnectCallback is called
Declaration
public string DisconnectReason { get; }
Property Value
Type | Description |
---|---|
string |
IsListening
Is true when a server or host is listening for connections. Is true when a client is connecting or connected to a network session. Is false when not listening, connecting, or connected.
Declaration
public bool IsListening { get; }
Property Value
Type | Description |
---|---|
bool |
Events
OnClientConnectedCallback
The callback to invoke once a client connects. This callback is only ran on the server and on the local client that connects.
Declaration
public event Action<ulong> OnClientConnectedCallback
Event Type
OnClientDisconnectCallback
The callback to invoke when a client disconnects. This callback is only ran on the server and on the local client that disconnects.
Declaration
public event Action<ulong> OnClientDisconnectCallback
Event Type
OnConnectionEvent
The callback to invoke once a peer connects. This callback is only ran on the server and on the local client that connects.
Declaration
public event Action<NetworkManager, ConnectionEventData> OnConnectionEvent
Event Type
Type | Description |
---|---|
Action<Network |
OnTransportFailure
The callback to invoke if the Network
Declaration
public event Action OnTransportFailure
Event Type
Type | Description |
---|---|
Action |
Remarks
A failure of the transport is always followed by the Network