Struct NetworkConnection
Public representation of a connection. This is obtained by calling Accept() (on servers) or Connect(NetworkEndpoint) (on clients) and acts as a handle to the communication session with a remote peer.
Implements
Inherited Members
Namespace: Unity.Networking.Transport
Assembly: solution.dll
Syntax
public struct NetworkConnection : IEquatable<NetworkConnection>
Properties
| Name | Description |
|---|---|
| IsCreated | Whether the connection was correctly obtained from a call to Accept() or Connect(NetworkEndpoint). |
Methods
| Name | Description |
|---|---|
| Close(NetworkDriver) | Close an active connection. Strictly identical to Disconnect(NetworkDriver). |
| Disconnect(NetworkDriver) | Close an active connection. Strictly identical to Close(NetworkDriver). |
| Equals(object) | Indicates whether this instance and a specified object are equal. |
| Equals(NetworkConnection) | Indicates whether the current object is equal to another object of the same type. |
| GetHashCode() | Returns the hash code for this instance. |
| GetState(NetworkDriver) | Get the current state of a connection. |
| PopEvent(NetworkDriver, out DataStreamReader) | Pop the next available event on the connection. |
| PopEvent(NetworkDriver, out DataStreamReader, out NetworkPipeline) | Pop the next available event on the connection. |
| ToFixedString() | Return a fixed string representation of the connection. For use in contexts where ToString() can't be used (e.g. Burst-compiled code). |
| ToString() | Returns the fully qualified type name of this instance. |
Operators
| Name | Description |
|---|---|
| operator ==(NetworkConnection, NetworkConnection) | |
| operator !=(NetworkConnection, NetworkConnection) |