WebRTC Video Chat 1.1.4
Loading...
Searching...
No Matches
Byn.Awrtc.LocalNetwork Class Reference

LocalNetwork. Simulate the IBasicNetwork locally in a single applicaiton. More...

Inheritance diagram for Byn.Awrtc.LocalNetwork:
Byn.Awrtc.IBasicNetwork Byn.Awrtc.INetwork

Public Member Functions

 LocalNetwork ()
 Creates a new local network.
 
void StartServer (string serverAddress=null)
 Starts a server to allow incoming connections.
 
void StopServer ()
 Stops allowing incoming connections.
 
ConnectionId Connect (string address)
 Connects to another address.
 
void Shutdown ()
 Disconnects all, StopsServer.
 
bool SendData (ConnectionId userId, byte[] data, int offset, int length, bool reliable)
 
void Update ()
 Call this every frame if you intend to read incoming messages using Dequeue. This will make sure all data is read received by the network.
 
bool Dequeue (out NetworkEvent evt)
 Returns the next buffered network event.
 
bool Peek (out NetworkEvent evt)
 Gets the next network event if there is any.
 
void Flush ()
 Flushes buffers (not used)
 
void Disconnect (ConnectionId id)
 Disconnects a peer.
 
void Dispose ()
 Disposable pattern. Will disconnect everything and destroy this object.
 

Static Public Attributes

static readonly string LOCK_ADDRESS = "LOCK_ADDRESS_TEST"
 Special address that is treated as in-use for testing purposes.
 

Protected Member Functions

virtual void Dispose (bool disposing)
 Called during disposing.
 

Properties

IList< ConnectionIdConnections [get]
 Current list of used connection ids.
 
bool IsServer [get]
 True if accepting incoming connections.
 

Detailed Description

LocalNetwork. Simulate the IBasicNetwork locally in a single applicaiton.

Member Function Documentation

◆ Connect()

ConnectionId Byn.Awrtc.LocalNetwork.Connect ( string address)

Connects to another address.

Parameters
address
Returns

Implements Byn.Awrtc.IBasicNetwork.

◆ Dequeue()

bool Byn.Awrtc.LocalNetwork.Dequeue ( out NetworkEvent evt)

Returns the next buffered network event.

Parameters
evt
Returns

Implements Byn.Awrtc.INetwork.

◆ Disconnect()

void Byn.Awrtc.LocalNetwork.Disconnect ( ConnectionId id)

Disconnects a peer.

Parameters
id

Implements Byn.Awrtc.INetwork.

◆ Dispose()

virtual void Byn.Awrtc.LocalNetwork.Dispose ( bool disposing)
protectedvirtual

Called during disposing.

Parameters
disposing

◆ Flush()

void Byn.Awrtc.LocalNetwork.Flush ( )

Flushes buffers (not used)

Implements Byn.Awrtc.INetwork.

◆ Peek()

bool Byn.Awrtc.LocalNetwork.Peek ( out NetworkEvent evt)

Gets the next network event if there is any.

Parameters
evt
Returns

Implements Byn.Awrtc.INetwork.

◆ SendData()

bool Byn.Awrtc.LocalNetwork.SendData ( ConnectionId userId,
byte[] data,
int offset,
int length,
bool reliable )
Parameters
userId
data
offset
length
reliable
Returns

Implements Byn.Awrtc.INetwork.

◆ Shutdown()

void Byn.Awrtc.LocalNetwork.Shutdown ( )

Disconnects all, StopsServer.

Implements Byn.Awrtc.INetwork.

◆ StartServer()

void Byn.Awrtc.LocalNetwork.StartServer ( string serverAddress = null)

Starts a server to allow incoming connections.

Parameters
serverAddress

Implements Byn.Awrtc.IBasicNetwork.

◆ StopServer()

void Byn.Awrtc.LocalNetwork.StopServer ( )

Stops allowing incoming connections.

Implements Byn.Awrtc.IBasicNetwork.

◆ Update()

void Byn.Awrtc.LocalNetwork.Update ( )

Call this every frame if you intend to read incoming messages using Dequeue. This will make sure all data is read received by the network.

Implements Byn.Awrtc.INetwork.


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