WebRTC Network
0.96
|
Interface to a network that doesn't enforce storing any states. More...
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... | |
Interface to a network that doesn't enforce storing any states.
Anything more is reusable between multiple different networks.
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.
evt |
Implemented in Byn.Net.LocalNetwork.
void Byn.Net.INetwork.Disconnect | ( | ConnectionId | id | ) |
Disconnects the given connection
id | Id 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.
evt |
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.
id | The id of the recipient |
data | Byte array containing the data to send |
offset | The index in data where the network should start to send |
length | Length in bytes you want to send |
reliable | True 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.