NetworkTransport Methods
The NetworkTransport type exposes the following members.
Methods
Name | Description | |
---|---|---|
Configure |
Configures the socket with the provided IP address, TCP port, UDP port, and idle timeout.
|
|
Connect |
Establishes a connection with the socket if it is not already started or connected.
If the direction is set to Server and the onServerStarted event is not null, it invokes the event.
|
|
Disconnect |
Disconnects the socket if it is started or connected.
|
|
GetConnectionType |
Retrieves the connection type of the socket.
|
|
GetPingAverage |
Get the average ping time for the network manager.
|
|
GetSocket |
Gets the network socket associated with this instance.
|
|
IsConnected |
Checks if the network socket is connected.
|
|
OnClientConnected |
Sets the action to be invoked when a client is connected to the server.
|
|
OnClientDisconnected |
Sets the action to be invoked when a client is disconnected from the server.
|
|
OnConnected |
Sets the action to be invoked when a client is connected.
|
|
OnConnectedRelayServer |
Sets the action to be invoked when a client is connected to the relay server.
|
|
OnConnectionFailed |
Sets the action to be invoked when a connection attempt fails.
|
|
OnDisconnected |
Sets the action to be invoked when a client is disconnected.
|
|
OnLoginFailed |
Sets the action to be invoked when a login attempt fails.
|
|
OnLoginSucess |
Sets the action to be invoked when a login attempt is successful.
|
|
OnServerRestarted |
Sets the action to be invoked when a server restart was detected by client.
|
|
OnServerStarted |
Sets the action to be invoked when the server is started.
|
|
RegisterAwake |
Register a callback method to be invoked when the network manager awakes.
|
|
Send |
Send a method for global listener.
This event will be caught by the network manager and handled globally.
|
|
SetAutoConnect |
Set whether the network manager should automatically connect.
|
|
SetConnectionType |
Set the connection type for the network manager.
|
|
SetIdleTimeout |
Sets the idle timeout for the socket.
|
|
SetIp |
Sets the IP address for the socket.
|
|
SetLatencyMeasure |
Enable or disable latency measurement for the network manager.
|
|
SetTcpPort |
Sets the TCP port for the socket.
|
|
SetUdpPort |
Sets the UDP port for the socket.
|
|
UnRegisterAwake |
Unregister a callback method from being invoked when the network manager awakes.
|
|
Update |
Update is called every frame, if the MonoBehaviour is enabled.
It processes network socket operations and sends pings if necessary.
|