Select your preferred scripting language. All code snippets will be displayed in this language.
class in UnityEngine.Networking
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
CloseHigh level UNET client.
It can be used to connect to a high level UNET server instance (NetworkServer).
active | True if a network client is currently active. |
allClients | A list of all the active network clients in the current process. |
connection | The NetworkConnection object this client is using. |
handlers | The registered network message handlers. |
hostTopology | The host topology that this client is using. |
isConnected | This gives the current connection status of the client. |
networkConnectionClass | The class to use when creating new NetworkConnections. |
numChannels | The number of QoS channels currently configured for this client. |
peers | The other network participants in the current game. |
serverIp | The IP address of the server that this client is connected to. |
serverPort | The port of the server that this client is connected to. |
NetworkClient | Creates a new NetworkClient instance. |
Configure | This configures the transport layer settings for a client. |
Connect | Connect client to a NetworkServer instance. |
ConnectWithSimulator | Connect client to a NetworkServer instance with simulated latency and packet loss. |
Disconnect | Disconnect from server. |
GetConnectionStats | Retrieves statistics about the network packets sent on this connection. |
GetRTT | Gets the Return Trip Time for this connection. |
GetStatsIn | Get inbound network statistics for the client. |
GetStatsOut | Get outbound network statistics for the client. |
RegisterHandler | Register a handler for a particular message type. |
ResetConnectionStats | Resets the statistics return by NetworkClient.GetConnectionStats() to zero values. |
Send | This sends a network message with a message Id to the server. This message is sent on channel zero, which be default is the reliable channel. |
SendByChannel | This sends a network message with a message Id to the server on a specific channel. |
SendBytes | This sends the data in an array of bytes to the server that the client is connected to. |
SendUnreliable | This sends a network message with a message Id to the server on channel one, which be default is the un-reliable channel. |
SendWriter | This sends the contents of the NetworkWriter's buffer to the connected server on the specified channel. |
SetMaxDelay | Set the maximum amount of time that can pass for transmitting the send buffer. |
SetNetworkConnectionClass | This sets the class that is used when creating new network connections. |
Shutdown | Shut down a client. |
UnregisterHandler | Unregisters a network message handler. |
GetTotalConnectionStats | Retrieves statistics about the network packets sent on all connections. |
ShutdownAll | Shuts down all network clients. |