Interface INetworkInterface | Unity Transport | 0.2.4-preview.0
docs.unity3d.com
    Show / Hide Table of Contents

    Interface INetworkInterface

    Namespace: Unity.Networking.Transport
    Syntax
    public interface INetworkInterface : IDisposable

    Properties

    Family

    The Interface Family is used to indicate what type of medium we are trying to use. See NetworkFamily

    Declaration
    NetworkFamily Family { get; }
    Property Value
    Type Description
    NetworkFamily

    LocalEndPoint

    Declaration
    NetworkEndPoint LocalEndPoint { get; }
    Property Value
    Type Description
    NetworkEndPoint

    RemoteEndPoint

    Declaration
    NetworkEndPoint RemoteEndPoint { get; }
    Property Value
    Type Description
    NetworkEndPoint

    Methods

    Bind(NetworkEndPoint)

    Binds the medium to a specific endpoint.

    Declaration
    int Bind(NetworkEndPoint endpoint)
    Parameters
    Type Name Description
    NetworkEndPoint endpoint

    A valid NetworkEndPoint, can be implicitly cast using an .

    Returns
    Type Description
    Int32

    0 on Success

    Initialize()

    Declaration
    void Initialize()

    ScheduleReceive<T>(T, JobHandle)

    Schedule a ReceiveJob. This is used to read data from your supported medium and pass it to the AppendData function supplied by the INetworkPacketReceiver

    Declaration
    JobHandle ScheduleReceive<T>(T receiver, JobHandle dep)
        where T : struct, INetworkPacketReceiver
    Parameters
    Type Name Description
    T receiver

    A INetworkPacketReceiver used to parse the data received.

    JobHandle dep

    A to any dependency we might have.

    Returns
    Type Description
    JobHandle

    A to our newly created ScheduleReceive Job.

    Type Parameters
    Name Description
    T

    Need to be of type INetworkPacketReceiver

    SendMessage(network_iovec*, Int32, ref NetworkEndPoint)

    Sends a message using the underlying medium.

    Declaration
    int SendMessage(network_iovec*iov, int iov_len, ref NetworkEndPoint address)
    Parameters
    Type Name Description
    network_iovec* iov

    An array of network_iovec.

    Int32 iov_len

    Lenght of the iov array passed in.

    NetworkEndPoint address

    The address of the remote host we want to send data to.

    Returns
    Type Description
    Int32
    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