Skip to main content

Unity.Networking.Transport.BaselibNetworkInterface

Default NetworkInterface implementation based on Unity's internal Baselib UDP sockets this is ensure to work on all platforms except for Unity's WebGL.

Implements#

INetworkInterface

System.IDisposable

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 BaselibNetworkInterface : INetworkInterface, IDisposable

DefaultParameters#

Default Parameters for BaselibNetworkInterface

Declaration#

public static BaselibNetworkParameter DefaultParameters

Field Value#

TypeDescription
BaselibNetworkParameter

#

IsCreated#

Gets if the interface has been created.

Declaration#

public readonly bool IsCreated { get; }

Property Value#

TypeDescription
System.Boolean

LocalEndPoint#

Returns the local endpoint the BaselibNetworkInterface is bound to.

Declaration#

public readonly NetworkInterfaceEndPoint LocalEndPoint { get; }

Property Value#

TypeDescription
NetworkInterfaceEndPointNetworkInterfaceEndPoint

#

Bind(NetworkInterfaceEndPoint)#

Binds the medium to a specific endpoint.

Declaration#

public int Bind(NetworkInterfaceEndPoint endpoint)

Parameters#

TypeNameDescription
NetworkInterfaceEndPointendpointA valid NetworkInterfaceEndPoint.

Returns#

TypeDescription
System.Int32Returns 0 on success.

CreateInterfaceEndPoint(NetworkEndPoint, out NetworkInterfaceEndPoint)#

Converts a generic NetworkEndPoint to its NetworkInterfaceEndPoint version for the BaselibNetworkInterface.

Declaration#

public int CreateInterfaceEndPoint(NetworkEndPoint address, out NetworkInterfaceEndPoint endpoint)

Parameters#

TypeNameDescription
NetworkEndPointaddressThe NetworkEndPoint endpoint to convert.
NetworkInterfaceEndPointendpoint

Returns#

TypeDescription
System.Int32returns 0 on success and sets the converted endpoint value

CreateSendInterface()#

Creates the send interface

Declaration#

public NetworkSendInterface CreateSendInterface()

Returns#

TypeDescription
NetworkSendInterfaceThe network send interface

Dispose()#

Disposes this instance

Declaration#

public void Dispose()

GetGenericEndPoint(NetworkInterfaceEndPoint)#

Converts a NetworkInterfaceEndPoint to its generic NetworkEndPoint version.

Declaration#

public NetworkEndPoint GetGenericEndPoint(NetworkInterfaceEndPoint endpoint)

Parameters#

TypeNameDescription
NetworkInterfaceEndPointendpointThe NetworkInterfaceEndPoint endpoint to convert.

Returns#

TypeDescription
NetworkEndPointReturns the converted endpoint value.

Initialize(INetworkParameter[])#

Initializes a instance of the BaselibNetworkInterface struct.

Declaration#

public int Initialize(params INetworkParameter[] param)

Parameters#

TypeNameDescription
INetworkParameter[]paramAn array of INetworkParameter. If there is no BaselibNetworkParameter present, the default values are used.

Returns#

TypeDescription
System.Int32Returns 0 on succees.

Listen()#

Listens on the socket, currently this Interface doesn't support listening as its UDP based.

Declaration#

public int Listen()

Returns#

TypeDescription
System.Int32Returns 0

ScheduleReceive(NetworkPacketReceiver, JobHandle)#

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

Declaration#

public JobHandle ScheduleReceive(NetworkPacketReceiver receiver, JobHandle dep)

Parameters#

TypeNameDescription
NetworkPacketReceiverreceiverA NetworkDriver used to parse the data received.
JobHandledepA to any dependency we might have.

Returns#

TypeDescription
JobHandleA to our newly created ScheduleReceive Job.

ScheduleSend(NativeQueue\<QueuedSendMessage>, JobHandle)#

Schedule a SendJob. This is used to flush send queues to your supported medium

Declaration#

public JobHandle ScheduleSend(NativeQueue<QueuedSendMessage> sendQueue, JobHandle dep)

Parameters#

TypeNameDescription
NativeQueue\<QueuedSendMessage>sendQueueThe send queue which can be used to emulate parallel send.
JobHandledepA to any dependency we might have.

Returns#

TypeDescription
JobHandleA to our newly created ScheduleSend Job.

Implements#

INetworkInterface

System.IDisposable