WebRTC Network  0.96
Public Member Functions | List of all members
Byn.Net.INetwork Interface Reference

Interface to a network that doesn't enforce storing any states. More...

Inheritance diagram for Byn.Net.INetwork:
Byn.Net.IBasicNetwork Byn.Net.IWebRtcNetwork Byn.Net.LocalNetwork

Public Member Functions

bool Dequeue (out NetworkEvent evt)
 This will return the incoming network events. Call this method and handle the incoming events until it returns false. More...
 
bool Peek (out NetworkEvent evt)
 Will return the first event in the queue without removing it. More...
 
void Flush ()
 Sends buffered data. More...
 
void SendData (ConnectionId id, byte[] data, int offset, int length, bool reliable)
 Sends the content if a byte array to the given connection. More...
 
void Disconnect (ConnectionId id)
 Disconnects the given connection More...
 
void Shutdown ()
 Disconnects all connection and shuts down the server if started. Dequeue will still return the confirmation messages such as Disconnected event for each connection. More...
 
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. More...
 

Detailed Description

Interface to a network that doesn't enforce storing any states.

Anything more is reusable between multiple different networks.

Member Function Documentation

bool Byn.Net.INetwork.Dequeue ( out NetworkEvent  evt)

This will return the incoming network events. Call this method and handle the incoming events until it returns false.

Parameters
evt
Returns
Returns true if the parameter evt contains a new event. False if there are no events to process left.

Implemented in Byn.Net.LocalNetwork.

void Byn.Net.INetwork.Disconnect ( ConnectionId  id)

Disconnects the given connection

Parameters
idId of the connection to disconnect.

Implemented in Byn.Net.LocalNetwork.

void Byn.Net.INetwork.Flush ( )

Sends buffered data.

Implemented in Byn.Net.LocalNetwork.

bool Byn.Net.INetwork.Peek ( out NetworkEvent  evt)

Will return the first event in the queue without removing it.

Parameters
evt
Returns

Implemented in Byn.Net.LocalNetwork.

void Byn.Net.INetwork.SendData ( ConnectionId  id,
byte[]  data,
int  offset,
int  length,
bool  reliable 
)

Sends the content if a byte array to the given connection.

Parameters
idThe id of the recipient
dataByte array containing the data to send
offsetThe index in data where the network should start to send
lengthLength in bytes you want to send
reliableTrue to send a reliable message(TCP style) and false to send unreliable (UDP style)

Implemented in Byn.Net.LocalNetwork.

void Byn.Net.INetwork.Shutdown ( )

Disconnects all connection and shuts down the server if started. Dequeue will still return the confirmation messages such as Disconnected event for each connection.

Implemented in Byn.Net.LocalNetwork.

void Byn.Net.INetwork.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.

Implemented in Byn.Net.LocalNetwork.


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