-
Notifications
You must be signed in to change notification settings - Fork 68
Description
I am using Laminar 0.5.0 in conjunction with Bevy 0.5.0 through my own systems (I'm not using a library such as the outdated bevy_prototype_network_laminar) and I'm left in a bit of a pickle.
Essentialy what I have is a client that sends packets and heartbeats every so often to the server as well as the other way around, both of which are made with laminar + bevy and run on the same machine. But sometimes the clients sends in many packets at once (around a hundred), and when it does, the server recieves those packets normally, but after doing so, all the subsequent heartbeats responses from the server somehow magically make more packets appear out of nowhere. Please take a look at this
(excuse me for my mousewriting)
On the client:

Total packets sent: 100
On the server:

Total packets received: 208
As you can see, everytime the server sends a hearbeat response back to the client, a portion of these packets reappear on the server even after the whole batch had been received. I have checked these packets and they do deserialize correctly into their structs so corruption isn't an issue. And I don't see a send message anywhere on the client.
If I do the same but for only send 30 packets:

Everything suddenly looks okay
Also, this doesn't happen if these packets are sent reliable ordered, so perhaps its only an issue with reliable unordered packets, but then it introduces another problem because these packets (if its a really high number like 400) are sort of "synchronized" to the heartbeats like this:

The total number of received packets is correct but the second batch here arrives very late (a heartbeat lasts 2 seconds) and from my observations it happens right after some heartbeat response, not any earlier or later. Is this expected behaviour? Or should I open another issue for this?
I have thought of using enet or another library for this, but changing all of this code would be fustrating. Any idea why all of this happens?