lidgren / lidgren-network-gen3

Lidgren Network Library
https://groups.google.com/forum/#!forum/lidgren-network-gen3
MIT License
1.19k stars 331 forks source link

Will lidgren combine small messages to one UDP packet? #37

Closed heroboy closed 9 years ago

MichaelDePiazzi commented 9 years ago

Yes, but the time for coalescing messages is very short (I think @lidgren mentioned that it was about 3 heartbeats, which is very fast). But generally if you send all of the messages at the same time, then they will be combined into 1 packet (assuming it doesn't exceed the MTU size and fragment the packet). I am doing this, and it seems to work well for me. You can check how many packets are actually being sent by looking at the connections "Statistics.SentPackets" property.

lidgren commented 9 years ago

That is correct.