Streaming Bytes

When a large amount of data and/or type of data that can't be sent with Bolt properties (such as images, dictionaries) needs to be sent over the network, streaming is invaluable.

First you will need to set the max amount of data streamed for second.

When placed in your server callbacks, this configures the initial stream traffic of new connections to 20 kb/s.

You will then want to create binary streaming channels on the client and the host.

The first parameter names the channel, the second makes the channel reliable or unreliable and the third marks the priority.

Then you can send a binary stream of data to this connection. Here is an example of sending the binary data of a custom icon texture to the server using a static reference to the "PlayerIcon" channel that was created inside a Channels class.

Then you will need a callback for when the binary stream data is received.

Then you will be able to do whatever you want with the data after receiving it. Now let's put all these steps together to make a simple example.

Be careful with how much data you stream, as there is a limit to how much you can.

 To Document Top