The NetworkDriver is an implementation of Virtual Connections over any
transport.
Basic usage:
Inherited Members#
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Namespace: System.Dynamic.ExpandoObject#
Assembly: MLAPI.dll#
Syntax#
Constructors#
NetworkDriver(INetworkInterface, INetworkParameter[])#
Constructor for NetworkDriver.
Declaration#
Parameters#
Type | Name | Description |
---|
INetworkInterface | netIf | |
INetworkParameter[] | param | An array of INetworkParameter. There are currently only two INetworkParameter, the NetworkDataStreamParameter and the NetworkConfigParameter. |
Exceptions#
Type | Condition |
---|
System.ArgumentException | Thrown if the value for NetworkDataStreamParameter.size is smaller then zero. |
Properties#
IsCreated#
Declaration#
Property Value#
Type | Description |
---|
System.Boolean | |
LastUpdateTime#
Declaration#
Property Value#
Type | Description |
---|
System.Int64 | |
Listening#
Declaration#
Property Value#
Type | Description |
---|
System.Boolean | |
ReceiveErrorCode#
Declaration#
Property Value#
Type | Description |
---|
System.Int32 | |
Methods#
AbortSend(DataStreamWriter)#
Declaration#
Parameters#
Type | Name | Description |
---|
DataStreamWriter | writer | |
Accept()#
Checks to see if there are any new connections to Accept.
Declaration#
Returns#
Type | Description |
---|
NetworkConnection | If accept fails it returnes a default NetworkConnection. |
BeginSend(NetworkConnection, out DataStreamWriter, Int32)#
Declaration#
Parameters#
Type | Name | Description |
---|
NetworkConnection | id | |
DataStreamWriter | writer | |
System.Int32 | requiredPayloadSize | |
Returns#
Type | Description |
---|
System.Int32 | |
BeginSend(NetworkPipeline, NetworkConnection, out DataStreamWriter, Int32)#
Declaration#
Parameters#
Type | Name | Description |
---|
NetworkPipeline | pipe | |
NetworkConnection | id | |
DataStreamWriter | writer | |
System.Int32 | requiredPayloadSize | |
Returns#
Type | Description |
---|
System.Int32 | |
Bind(NetworkEndPoint)#
Bind the driver to a endpoint.
Declaration#
Parameters#
Type | Name | Description |
---|
NetworkEndPoint | endpoint | The endpoint to bind to. |
Returns#
Type | Description |
---|
System.Int32 | Returns 0 on success. And a negative value if a error occured. |
Exceptions#
Type | Condition |
---|
System.InvalidOperationException | If the driver is not created properly |
System.InvalidOperationException | If bind is called more then once on the driver |
System.InvalidOperationException | If bind is called after a connection has already been established |
Connect(NetworkEndPoint)#
Connects the driver to a endpoint
Declaration#
Parameters#
Type | Name | Description |
---|
NetworkEndPoint | endpoint | |
Returns#
Type | Description |
---|
NetworkConnection | If connect fails it returns a default NetworkConnection. |
Exceptions#
Type | Condition |
---|
System.InvalidOperationException | If the driver is not created properly |
Create(INetworkParameter[])#
Helper function for creating a NetworkDriver.
Declaration#
Parameters#
Type | Name | Description |
---|
INetworkParameter[] | param | An optional array of INetworkParameter. There are currently only two INetworkParameter, the NetworkDataStreamParameter and the NetworkConfigParameter. |
Returns#
Type | Description |
---|
NetworkDriver | |
Exceptions#
Type | Condition |
---|
System.InvalidOperationException | |
CreatePipeline(Type[])#
Declaration#
Parameters#
Type | Name | Description |
---|
System.Type[] | stages | An array of stages the pipeline should contain. |
Returns#
Type | Description |
---|
NetworkPipeline | |
Exceptions#
Type | Condition |
---|
System.InvalidOperationException | If the driver is not created properly |
System.InvalidOperationException | A connection has already been established |
Disconnect(NetworkConnection)#
Disconnects a NetworkConnection
Declaration#
Parameters#
Type | Name | Description |
---|
NetworkConnection | id | The NetworkConnection we want to Disconnect. |
Returns#
Type | Description |
---|
System.Int32 | Return 0 on success. |
Dispose()#
Declaration#
EndSend(DataStreamWriter)#
Declaration#
Parameters#
Type | Name | Description |
---|
DataStreamWriter | writer | |
Returns#
Type | Description |
---|
System.Int32 | |
GetConnectionState(NetworkConnection)#
Declaration#
Parameters#
Type | Name | Description |
---|
NetworkConnection | con | |
Returns#
Type | Description |
---|
NetworkConnection.State | |
GetEventQueueSizeForConnection(NetworkConnection)#
Returns the size of the eventqueue for a specific connection
Declaration#
Parameters#
Type | Name | Description |
---|
NetworkConnection | connectionId | |
Returns#
Type | Description |
---|
System.Int32 | If the connection is valid it returns the size of the event queue otherwise it returns 0. |
GetPipelineBuffers(NetworkPipeline, NetworkPipelineStageId, NetworkConnection, out NativeArray<Byte>, out NativeArray<Byte>, out NativeArray<Byte>)#
Returns the PipelineBuffers for a specific pipeline and stage.
Declaration#
Parameters#
Type | Name | Description |
---|
NetworkPipeline | pipeline | |
NetworkPipelineStageId | stageId | |
NetworkConnection | connection | |
Unity.Collections.NativeArray<System.Byte> | readProcessingBuffer | |
Unity.Collections.NativeArray<System.Byte> | writeProcessingBuffer | |
Unity.Collections.NativeArray<System.Byte> | sharedBuffer | |
Exceptions#
Type | Condition |
---|
System.InvalidOperationException | If the the connection is invalid. |
Listen()#
Set the driver to Listen for incomming connections
Declaration#
Returns#
Type | Description |
---|
System.Int32 | Returns 0 on success. |
Exceptions#
Type | Condition |
---|
System.InvalidOperationException | If the driver is not created properly |
System.InvalidOperationException | If listen is called more then once on the driver |
System.InvalidOperationException | If bind has not been called before calling Listen. |
LocalEndPoint()#
Declaration#
Returns#
Type | Description |
---|
NetworkEndPoint | |
MaxHeaderSize(NetworkPipeline)#
Declaration#
Parameters#
Type | Name | Description |
---|
NetworkPipeline | pipe | |
Returns#
Type | Description |
---|
System.Int32 | |
PopEvent(out NetworkConnection, out DataStreamReader)#
Declaration#
Parameters#
Type | Name | Description |
---|
NetworkConnection | con | |
DataStreamReader | reader | |
Returns#
Type | Description |
---|
NetworkEvent.Type | |
PopEvent(out NetworkConnection, out DataStreamReader, out NetworkPipeline)#
Declaration#
Parameters#
Type | Name | Description |
---|
NetworkConnection | con | |
DataStreamReader | reader | |
NetworkPipeline | pipeline | |
Returns#
Type | Description |
---|
NetworkEvent.Type | |
PopEventForConnection(NetworkConnection, out DataStreamReader)#
Declaration#
Parameters#
Type | Name | Description |
---|
NetworkConnection | connectionId | |
DataStreamReader | reader | |
Returns#
Type | Description |
---|
NetworkEvent.Type | |
PopEventForConnection(NetworkConnection, out DataStreamReader, out NetworkPipeline)#
Declaration#
Parameters#
Type | Name | Description |
---|
NetworkConnection | connectionId | |
DataStreamReader | reader | |
NetworkPipeline | pipeline | |
Returns#
Type | Description |
---|
NetworkEvent.Type | |
RemoteEndPoint(NetworkConnection)#
Declaration#
Parameters#
Type | Name | Description |
---|
NetworkConnection | id | |
Returns#
Type | Description |
---|
NetworkEndPoint | |
ScheduleFlushSend(JobHandle)#
Declaration#
Parameters#
Type | Name | Description |
---|
Unity.Jobs.JobHandle | dep | |
Returns#
Type | Description |
---|
Unity.Jobs.JobHandle | |
ScheduleUpdate(JobHandle)#
Declaration#
Parameters#
Type | Name | Description |
---|
Unity.Jobs.JobHandle | dep | |
Returns#
Type | Description |
---|
Unity.Jobs.JobHandle | |
ToConcurrent()#
Create a Concurrent Copy of the NetworkDriver.
Declaration#
Returns#
Type | Description |
---|
NetworkDriver.Concurrent | |
Implements#