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: transport.dll#
Syntax#
NetworkDriver(INetworkInterface)#
Declaration#
Parameters#
Type | Name | Description |
---|
INetworkInterface | netIf | |
NetworkDriver(INetworkInterface, INetworkParameter[])#
Declaration#
Parameters#
Type | Name | Description |
---|
INetworkInterface | netIf | |
INetworkParameter[] | param | |
NetworkDriver(INetworkInterface, NetworkSettings)#
Declaration#
Parameters#
Type | Name | Description |
---|
INetworkInterface | netIf | |
NetworkSettings | settings | |
Bound#
Declaration#
Property Value#
Type | Description |
---|
System.Boolean | |
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 | |
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. |
AllocateMemory(ref Int32)#
Allocates temporary memory in NetworkDriver's data stream. You don't
need to deallocate it If you need to call this function several times -
use PinMemoryTillUpdate(Int32) to move 'head'
Declaration#
Parameters#
Type | Name | Description |
---|
System.Int32 | dataLen | Size of memory to allocate in bytes. Must be > 0 |
Returns#
Type | Description |
---|
System.IntPtr | Pointer to allocated memory or IntPtr.Zero if there is no space left (this function doesn't set ReceiveErrorCode! caller should decide if this is Out of memory or something else) |
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()#
Declaration#
Returns#
Type | Description |
---|
NetworkDriver | |
Create(INetworkParameter[])#
Declaration#
Parameters#
Type | Name | Description |
---|
INetworkParameter[] | param | |
Returns#
Type | Description |
---|
NetworkDriver | |
Create(NetworkSettings)#
Helper function for creating a NetworkDriver.
Declaration#
Parameters#
Type | Name | Description |
---|
NetworkSettings | settings | |
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 | |
NativeArray<System.Byte> | readProcessingBuffer | |
NativeArray<System.Byte> | writeProcessingBuffer | |
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 | |
PinMemoryTillUpdate(Int32)#
Moves 'head' of allocator for 'length' bytes. Use this to 'pin' memory
in till the next update. If you don't call it - it is 'pinned' till the
next call to AllocateMemory(ref Int32) Means every time you call
AllocateMemory(ref Int32) without PinMemoryTillUpdate(Int32) memory is
overriden
Declaration#
Parameters#
Type | Name | Description |
---|
System.Int32 | length | Bytes to move |
Returns#
Type | Description |
---|
System.Int32 | Returns head of pinned memory |
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 |
---|
JobHandle | dependency | |
Returns#
ScheduleUpdate(JobHandle)#
Declaration#
Parameters#
Type | Name | Description |
---|
JobHandle | dependency | |
Returns#
ToConcurrent()#
Create a Concurrent Copy of the NetworkDriver.
Declaration#
Returns#
Type | Description |
---|
NetworkDriver.Concurrent | |
Implements#