Space Engineers
Classes | Public Types | Public Member Functions | Public Attributes | Properties | List of all members
Sandbox.Engine.Networking.MyReceiveQueue Class Reference

Receives messages from Steam immediatelly on separate thread Precise receive time is required for proper interpolation More...

Inheritance diagram for Sandbox.Engine.Networking.MyReceiveQueue:

Public Types

enum  Mode { Mode.Synchronized, Mode.Timer, Mode.Spin }
 

Public Member Functions

 MyReceiveQueue (int channel, Action< ulong > disconnectPeerOnError, Mode readMode=Mode.Synchronized, int defaultMessageCount=1, Func< MyTimeSpan > timestampProvider=null)
 
void Clear ()
 
void AddMessage (byte[] data, int length, ulong sender)
 Enqueues message for processing, useful for loopback More...
 
void Process (NetworkMessageDelegate handler, MyTimeSpan delay=default(MyTimeSpan))
 Processes messages Delay indicates how long must be message in queue before processing (lag emulation) More...
 
void Dispose ()
 

Public Attributes

readonly int Channel
 
readonly Mode ReadMode
 
bool Started = false
 

Properties

bool Disposed [get]
 

Detailed Description

Receives messages from Steam immediatelly on separate thread Precise receive time is required for proper interpolation

Definition at line 16 of file MyReceiveQueue.cs.

Member Enumeration Documentation

Enumerator
Synchronized 

Read messages synchronized when calling Process, timestamps won't be accurate

Timer 

High precision timer will read messages (1ms intervals)

Spin 

Messages will be read in spin cycle, HIGH CPU USAGE!

Definition at line 18 of file MyReceiveQueue.cs.

Constructor & Destructor Documentation

Sandbox.Engine.Networking.MyReceiveQueue.MyReceiveQueue ( int  channel,
Action< ulong >  disconnectPeerOnError,
Mode  readMode = Mode.Synchronized,
int  defaultMessageCount = 1,
Func< MyTimeSpan timestampProvider = null 
)
inline

Definition at line 64 of file MyReceiveQueue.cs.

Member Function Documentation

void Sandbox.Engine.Networking.MyReceiveQueue.AddMessage ( byte[]  data,
int  length,
ulong  sender 
)
inline

Enqueues message for processing, useful for loopback

Definition at line 185 of file MyReceiveQueue.cs.

void Sandbox.Engine.Networking.MyReceiveQueue.Clear ( )
inline

Definition at line 177 of file MyReceiveQueue.cs.

void Sandbox.Engine.Networking.MyReceiveQueue.Dispose ( )
inline

Definition at line 259 of file MyReceiveQueue.cs.

void Sandbox.Engine.Networking.MyReceiveQueue.Process ( NetworkMessageDelegate  handler,
MyTimeSpan  delay = default(MyTimeSpan) 
)
inline

Processes messages Delay indicates how long must be message in queue before processing (lag emulation)

Definition at line 203 of file MyReceiveQueue.cs.

Member Data Documentation

readonly int Sandbox.Engine.Networking.MyReceiveQueue.Channel

Definition at line 58 of file MyReceiveQueue.cs.

readonly Mode Sandbox.Engine.Networking.MyReceiveQueue.ReadMode

Definition at line 59 of file MyReceiveQueue.cs.

bool Sandbox.Engine.Networking.MyReceiveQueue.Started = false

Definition at line 61 of file MyReceiveQueue.cs.

Property Documentation

bool Sandbox.Engine.Networking.MyReceiveQueue.Disposed
get

Definition at line 57 of file MyReceiveQueue.cs.


The documentation for this class was generated from the following file: