Struct NetworkDriver.Concurrent | Unity Transport | 0.6.0-preview.7
docs.unity3d.com
    Show / Hide Table of Contents

    Struct NetworkDriver.Concurrent

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

    Namespace: Unity.Networking.Transport
    Syntax
    public struct Concurrent

    Methods

    AbortSend(DataStreamWriter)

    Aborts a asynchronous send.

    Declaration
    public void AbortSend(DataStreamWriter writer)
    Parameters
    Type Name Description
    DataStreamWriter writer

    If you require the payload to be of certain size.

    Exceptions
    Type Condition
    InvalidOperationException

    If endsend is called with a matching BeginSend call.

    InvalidOperationException

    If 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
    Type Name Description
    NetworkConnection id

    The NetworkConnection id to write through

    DataStreamWriter writer

    A DataStreamWriter to write to

    Int32 requiredPayloadSize

    If you require the payload to be of certain size

    Returns
    Type Description
    Int32

    Returns Success on a successful acquire. Otherwise returns an StatusCode indicating the error.

    Remarks

    Will throw a 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
    Type Name Description
    NetworkPipeline pipe

    The NetworkPipeline to write through

    NetworkConnection id

    The NetworkConnection id to write through

    DataStreamWriter writer

    A DataStreamWriter to write to

    Int32 requiredPayloadSize

    If you require the payload to be of certain size

    Returns
    Type Description
    Int32

    Returns Success on a successful acquire. Otherwise returns an StatusCode indicating the error.

    Remarks

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

    EndSend(DataStreamWriter)

    Ends a asynchronous send.

    Declaration
    public int EndSend(DataStreamWriter writer)
    Parameters
    Type Name Description
    DataStreamWriter writer

    If you require the payload to be of certain size.

    Returns
    Type Description
    Int32

    The length of the buffer sent if nothing went wrong.

    Exceptions
    Type Condition
    InvalidOperationException

    If endsend is called with a matching BeginSend call.

    InvalidOperationException

    If the connection got closed between the call of being and end send.

    GetConnectionState(NetworkConnection)

    Declaration
    public NetworkConnection.State GetConnectionState(NetworkConnection id)
    Parameters
    Type Name Description
    NetworkConnection id
    Returns
    Type Description
    NetworkConnection.State

    MaxHeaderSize(NetworkPipeline)

    Declaration
    public int MaxHeaderSize(NetworkPipeline pipe)
    Parameters
    Type Name Description
    NetworkPipeline pipe
    Returns
    Type Description
    Int32

    PopEventForConnection(NetworkConnection, out DataStreamReader)

    Declaration
    public NetworkEvent.Type PopEventForConnection(NetworkConnection connectionId, out DataStreamReader reader)
    Parameters
    Type Name Description
    NetworkConnection connectionId
    DataStreamReader reader
    Returns
    Type Description
    NetworkEvent.Type
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023