Struct 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.
Inherited Members
Namespace: Unity.Networking.Transport
Assembly: Unity.Networking.Transport.dll
Syntax
public struct BaselibNetworkInterface : INetworkInterface, IDisposable
Fields
DefaultParameters
Default Parameters for Baselib
Declaration
public static BaselibNetworkParameter DefaultParameters
Field Value
Type | Description |
---|---|
Baselib |
Properties
IsCreated
Gets if the interface has been created.
Declaration
public bool IsCreated { get; }
Property Value
Type | Description |
---|---|
bool |
LocalEndPoint
Returns the local endpoint the Baselib
Declaration
public NetworkInterfaceEndPoint LocalEndPoint { get; }
Property Value
Type | Description |
---|---|
Network |
NetworkInterfaceEndPoint |
Methods
Bind(NetworkInterfaceEndPoint)
Binds the medium to a specific endpoint.
Declaration
public int Bind(NetworkInterfaceEndPoint endpoint)
Parameters
Type | Name | Description |
---|---|---|
Network |
endpoint | A valid Network |
Returns
Type | Description |
---|---|
int | Returns 0 on success. |
CreateInterfaceEndPoint(NetworkEndPoint, out NetworkInterfaceEndPoint)
Converts a generic Network
Declaration
public int CreateInterfaceEndPoint(NetworkEndPoint address, out NetworkInterfaceEndPoint endpoint)
Parameters
Type | Name | Description |
---|---|---|
Network |
address | The Network |
Network |
endpoint | The new Network |
Returns
Type | Description |
---|---|
int | returns 0 on success and sets the converted endpoint value |
CreateSendInterface()
Creates the send interface
Declaration
public NetworkSendInterface CreateSendInterface()
Returns
Type | Description |
---|---|
Network |
The network send interface |
Dispose()
Disposes this instance
Declaration
public void Dispose()
GetGenericEndPoint(NetworkInterfaceEndPoint)
Converts a Network
Declaration
public NetworkEndPoint GetGenericEndPoint(NetworkInterfaceEndPoint endpoint)
Parameters
Type | Name | Description |
---|---|---|
Network |
endpoint | The Network |
Returns
Type | Description |
---|---|
Network |
Returns the converted endpoint value. |
Initialize(NetworkSettings)
Initializes a instance of the Baselib
Declaration
public int Initialize(NetworkSettings settings)
Parameters
Type | Name | Description |
---|---|---|
Network |
settings | Network |
Returns
Type | Description |
---|---|
int | Returns 0 on success. |
Listen()
Listens on the socket, currently this Interface doesn't support listening as its UDP based.
Declaration
public int Listen()
Returns
Type | Description |
---|---|
int | Returns 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 Network
Declaration
public JobHandle ScheduleReceive(NetworkPacketReceiver receiver, JobHandle dep)
Parameters
Type | Name | Description |
---|---|---|
Network |
receiver | A Network |
Job |
dep | A Job |
Returns
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
Type | Name | Description |
---|---|---|
Native |
sendQueue | The send queue which can be used to emulate parallel send. |
Job |
dep | A Job |