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 |
Returns
Type | Description |
---|---|
JobHandle | A |
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 |