docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct NetworkDriver

    The NetworkDriver is an implementation of Virtual Connections over any transport.

    Basic usage:

    var driver = NetworkDriver.Create();
    Implements
    IDisposable
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Unity.Networking.Transport
    Assembly: solution.dll
    Syntax
    public struct NetworkDriver : IDisposable

    Constructors

    Name Description
    NetworkDriver(INetworkInterface)
    NetworkDriver(INetworkInterface, params INetworkParameter[])
    NetworkDriver(INetworkInterface, NetworkSettings)

    Properties

    Name Description
    Bound

    Whether the driver is bound to an endpoint.

    IsCreated

    Returns if NetworkDriver has been created

    LastUpdateTime

    Gets the value of the last update time

    Listening

    Whether the driver is listening for connections.

    ReceiveErrorCode

    Gets or sets Receive Error Code

    Methods

    Name Description
    AbortSend(DataStreamWriter)

    Aborts a asynchronous send.

    Accept()

    Checks to see if there are any new connections to Accept.

    BeginSend(NetworkConnection, out DataStreamWriter, int)

    Acquires a DataStreamWriter for starting a asynchronous send.

    BeginSend(NetworkPipeline, NetworkConnection, out DataStreamWriter, int)

    Acquires a DataStreamWriter for starting a asynchronous send.

    Bind(NetworkEndPoint)

    Bind the driver to a endpoint.

    Connect(NetworkEndPoint)

    Connects the driver to a endpoint

    Create()

    Helper function for creating a NetworkDriver.

    Create(params INetworkParameter[])
    Create(NetworkSettings)

    Helper function for creating a NetworkDriver.

    CreatePipeline(params Type[])

    Create a new pipeline.

    Create<N>(N)

    Helper function for creating a NetworkDriver.

    Create<N>(N, NetworkSettings)

    Helper function for creating a NetworkDriver.

    Disconnect(NetworkConnection)

    Disconnects a NetworkConnection

    Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

    EndSend(DataStreamWriter)

    Ends a asynchronous send.

    GetConnectionState(NetworkConnection)

    Gets the connection state using the specified NetworkConnection

    GetEventQueueSizeForConnection(NetworkConnection)

    Returns the size of the EventQueue for a specific connection

    GetPipelineBuffers(NetworkPipeline, NetworkPipelineStageId, NetworkConnection, out NativeArray<byte>, out NativeArray<byte>, out NativeArray<byte>)

    Returns the PipelineBuffers for a specific pipeline and stage.

    Listen()

    Set the driver to Listen for incoming connections

    LocalEndPoint()

    Returns local NetworkEndPoint

    MaxHeaderSize(NetworkPipeline)

    Max headersize including optional NetworkPipeline

    PopEvent(out NetworkConnection, out DataStreamReader)

    Pops an event

    PopEvent(out NetworkConnection, out DataStreamReader, out NetworkPipeline)

    Pops an event

    PopEventForConnection(NetworkConnection, out DataStreamReader)

    Pops an event for a specific connection

    PopEventForConnection(NetworkConnection, out DataStreamReader, out NetworkPipeline)

    Pops an event for a specific connection

    RemoteEndPoint(NetworkConnection)
    ScheduleFlushSend(JobHandle)

    Schedules flushing the sendqueue. Should be called in cases where you want the driver to send before the next ScheduleUpdate(JobHandle) is called.

    ScheduleUpdate(JobHandle)

    Schedules update for driver. This should be called once a frame.

    ToConcurrent()

    Create a Concurrent Copy of the NetworkDriver.

    Extension Methods

    NetworkDriverRelayExtensions.Connect(NetworkDriver)
    NetworkDriverRelayExtensions.GetRelayConnectionStatus(NetworkDriver)
    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)