|
WebRTC Video Chat 1.1.4
|
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. | |
| bool | Peek (out NetworkEvent evt) |
| Will return the first event in the queue without removing it. | |
| void | Flush () |
| Sends buffered data. | |
| bool | SendData (ConnectionId id, byte[] data, int offset, int length, bool reliable) |
| Sends the content of a byte array to the given connection. | |
| void | Disconnect (ConnectionId id) |
| Disconnects the given connection. | |
| 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. | |
| 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. | |
Interface to a network that doesn't enforce storing any states.
Anything more is reusable between multiple different networks.
| bool Byn.Awrtc.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.Awrtc.LocalNetwork.
| void Byn.Awrtc.INetwork.Disconnect | ( | ConnectionId | id | ) |
Disconnects the given connection.
| id | Id of the connection to disconnect. |
Implemented in Byn.Awrtc.LocalNetwork.
| void Byn.Awrtc.INetwork.Flush | ( | ) |
Sends buffered data.
Implemented in Byn.Awrtc.LocalNetwork.
| bool Byn.Awrtc.INetwork.Peek | ( | out NetworkEvent | evt | ) |
Will return the first event in the queue without removing it.
| evt |
Implemented in Byn.Awrtc.LocalNetwork.
| bool Byn.Awrtc.INetwork.SendData | ( | ConnectionId | id, |
| byte[] | data, | ||
| int | offset, | ||
| int | length, | ||
| bool | reliable ) |
Sends the content of a byte array to the given connection.
Make sure to check the result of this method. False indicates the data wasn't sent.
Calls to SendData will store the data in an internal buffer. Once the network is ready the data will be sent.
Pitfalls and additional information:
| 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. Keep below 16,000,000 bytes |
| reliable | True to send a reliable message(TCP style) and false to send unreliable (UDP style). Reliable messages are ordered and will be resent if lost during transmission. They can still be dropped if the internal buffer overflows (will return false). Unreliable messages are sent without a specific order and won't be resent if delivery fails even if this method returned true! |
Implemented in Byn.Awrtc.LocalNetwork.
| void Byn.Awrtc.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.Awrtc.LocalNetwork.
| void Byn.Awrtc.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.Awrtc.LocalNetwork.