BoltConnection.StreamBytes latency?

Hi, I've been working on implementing Bolt as a separate network transport layer for an existing game. The game already does its own networked object, scene and state management. So far I've been able to get everything working, and I'm able to set up sessions and connect to them. All network packets are send over one reliable stream channel and one unreliable stream channel. However I notice there is considerable latency between these packets being send and received. I'm left wondering if I'm using the right tool here, as the stream channels seem intended for sending specific content like voice channels or textures. Is there an inherit latency in these stream channels? And if so, whats the alternative for sending packets rapidly?


  • There’s currently some issue with reliable streaming. Unreliable streaming is best for voice. You can find a large data transfer sample using events and a voice chat sample in the Bolt Sample Pack on the asset store
  • That doesn't really answer my question. The game currently sends all networking data over these streams. Player input and movement updates are pushed over the unreliable channel for example. However there seems to be a solid second of latency while testing with two Unity editor instances on the same machine. Is this inherit to the design of the streaming channels or should I be looking for the cause elsewhere?
  • Depending on the size of the data you’re streaming and your packet size/rate it may take longer for data to arrive
  • Packets are usually sub 1500 bytes, send multiple times per second. Stream bandwidth is 20kb/s (SetStreamBandwidth(1024 * 20)). Increasing this doesn't seem to change the latency. Is there some documentation about how the streaming channels function (how they buffer etc)?
  • I've been logging some of the network communication, and while the packets are send gradually spread out over each frame by the client, they are received in bursts by the server with delays up to a second. This is expected behaviour for the streaming channels? Is there a way to tweak that?
  • After a deeper dive into the udpkit library that Bolt uses ( I noticed it's the UdpSocket instance that I want access to, in order to send packets directly. I assume the BoltConnection class currently wraps around that?
  • Hello @ClavusCG ,

    Are you using which version of Bolt?

    You can find documentation about the Streams on Bolt here. But it conver just the surface of the topic.

    UdpKit has evolved since the latest commit on this repository (5 years ago), so it's not a real reference to whats the code is doing internally. You are right in the sense that BoltConnection uses the UdpSocket class, but it mainly depends on the platform you are using (e.g. DotNetPlatform or PhotonPlatform).

    About the bursts on the server, no, this is not expected, we will investigate. Are you testing using Bolt in Debug ou Release modes? Are the Latency settings enabled?

  • ClavusCGClavusCG
    edited January 22
    I'm using the latest version from the asset store (1.2.5). I've tried to run Bolt in both Debug and Release mode, but the latency seems to be the same. The Bolt Remotes window shows the other client to have a 20ms ping when it's just 2 editor instances on the same machine, but there's a massive delay between input and movement. Latency simulation is disabled of course.
  • Hello,

    How this behaves when you run both peers (client and server) as standalone instances?
  • ramonmelo said:


    How this behaves when you run both peers (client and server) as standalone instances?

    Yes. Running on the Android platform. Tried connecting between editor instances, standalone instances running on phones, non-dev builds, etc. The extra second of latency is always there.
Sign In or Register to comment.