Skip to main content

Unity.Networking.Transport.NetworkDriver.Concurrent

The Concurrent struct is used to create an Concurrent instance of the NetworkDriver.

Inherited Members#

ValueType.Equals(Object)

ValueType.GetHashCode()

ValueType.ToString()

Object.Equals(Object, Object)

Object.GetType()

Object.ReferenceEquals(Object, Object)

Namespace: System.Dynamic.ExpandoObject#
Assembly: transport.dll#
Syntax#
public struct Concurrent

AbortSend(DataStreamWriter)#

Aborts a asynchronous send.

Declaration#

public void AbortSend(DataStreamWriter writer)

Parameters#

TypeNameDescription
DataStreamWriterwriterIf you require the payload to be of certain size.

Exceptions#

TypeCondition
System.InvalidOperationExceptionIf endsend is called with a matching BeginSend call.
System.InvalidOperationExceptionIf the connection got closed between the call of being and end send.

BeginSend(NetworkConnection, out DataStreamWriter, Int32)#

Acquires a DataStreamWriter for starting a asynchronous send.

Declaration#

public int BeginSend(NetworkConnection id, out DataStreamWriter writer, int requiredPayloadSize = 0)

Parameters#

TypeNameDescription
NetworkConnectionidThe NetworkConnection id to write through
DataStreamWriterwriterA DataStreamWriter to write to
System.Int32requiredPayloadSizeIf you require the payload to be of certain size

Returns#

TypeDescription
System.Int32Returns Success on a successful acquire. Otherwise returns an StatusCode indicating the error.

Remarks#

Will throw a System.InvalidOperationException if the connection is in a Connecting state.

BeginSend(NetworkPipeline, NetworkConnection, out DataStreamWriter, Int32)#

Acquires a DataStreamWriter for starting a asynchronous send.

Declaration#

public int BeginSend(NetworkPipeline pipe, NetworkConnection id, out DataStreamWriter writer, int requiredPayloadSize = 0)

Parameters#

TypeNameDescription
NetworkPipelinepipeThe NetworkPipeline to write through
NetworkConnectionidThe NetworkConnection id to write through
DataStreamWriterwriterA DataStreamWriter to write to
System.Int32requiredPayloadSizeIf you require the payload to be of certain size

Returns#

TypeDescription
System.Int32Returns Success on a successful acquire. Otherwise returns an StatusCode indicating the error.

Remarks#

Will throw a System.InvalidOperationException if the connection is in a Connecting state.

EndSend(DataStreamWriter)#

Ends a asynchronous send.

Declaration#

public int EndSend(DataStreamWriter writer)

Parameters#

TypeNameDescription
DataStreamWriterwriterIf you require the payload to be of certain size.

Returns#

TypeDescription
System.Int32The length of the buffer sent if nothing went wrong.

Exceptions#

TypeCondition
System.InvalidOperationExceptionIf endsend is called with a matching BeginSend call.
System.InvalidOperationExceptionIf the connection got closed between the call of being and end send.

GetConnectionState(NetworkConnection)#

Gets the connection state using the specified id

Declaration#

public NetworkConnection.State GetConnectionState(NetworkConnection id)

Parameters#

TypeNameDescription
NetworkConnectionidThe connection id

Returns#

TypeDescription
NetworkConnection.StateThe network connection state

MaxHeaderSize(NetworkPipeline)#

Max headersize including a NetworkPipeline

Declaration#

public int MaxHeaderSize(NetworkPipeline pipe)

Parameters#

TypeNameDescription
NetworkPipelinepipeThe pipeline with which to get the maximum header size.

Returns#

TypeDescription
System.Int32The header size

PopEventForConnection(NetworkConnection, out DataStreamReader)#

Pops events for a connection using the specified connection id

Declaration#

public NetworkEvent.Type PopEventForConnection(NetworkConnection connectionId, out DataStreamReader reader)

Parameters#

TypeNameDescription
NetworkConnectionconnectionIdThe connection id
DataStreamReaderreaderStream reader for the event's data.

Returns#

TypeDescription
NetworkEvent.TypeThe network event type

PopEventForConnection(NetworkConnection, out DataStreamReader, out NetworkPipeline)#

Pops events for a connection using the specified connection id

Declaration#

public NetworkEvent.Type PopEventForConnection(NetworkConnection connectionId, out DataStreamReader reader, out NetworkPipeline pipeline)

Parameters#

TypeNameDescription
NetworkConnectionconnectionIdThe connection id
DataStreamReaderreaderStream reader for the event's data.
NetworkPipelinepipelinePipeline on which the data event was received.

Returns#

TypeDescription
NetworkEvent.TypeThe type