Struct NetworkStreamConnection
A connection is represented by an entity having a NetworkStreamConnection. The component hold a reference to the underlying transport Unity.Networking.Transport.NetworkConnection and the Unity.Networking.Transport.NetworkDriver that created it. All connections share a common set of components:
- OutgoingCommandDataStreamBuffer
Client connections also have a IncomingSnapshotDataStreamBuffer to handle server ghost snapshots.
Implements
Inherited Members
Namespace: Unity.NetCode
Assembly: Unity.NetCode.dll
Syntax
public struct NetworkStreamConnection : ICleanupComponentData, IComponentData, IQueryTypeParameter
Remarks
Never destroy this entity yourself. You'll receive an error if you attempt to do so.
Fields
CurrentState
Cache of the last state pulled from the driver.
Declaration
public ConnectionState.State CurrentState
Field Value
Type | Description |
---|---|
ConnectionState.State |
Remarks
May be stale, as only refreshed once per Unity.Entities.SimulationSystemGroup tick.
DriverId
The driver identifier that create the connection. Can be used to retrieve the Unity.Networking.Transport.NetworkDriver or the NetworkDriverStore.NetworkDriverInstance from the NetworkDriverStore.
Declaration
public int DriverId
Field Value
Type | Description |
---|---|
int |
ProtocolVersionReceived
Flag used to mark if the connection has exchanged the protocol version. 1 indicates that the remote version protocol has been received AND accepted (i.e. it's valid)!
Declaration
public int ProtocolVersionReceived
Field Value
Type | Description |
---|---|
int |
Value
The underlying transport Unity.Networking.Transport.NetworkConnection
Declaration
public NetworkConnection Value
Field Value
Type | Description |
---|---|
NetworkConnection |