-
Notifications
You must be signed in to change notification settings - Fork 450
feat: Allow reliable sends to go over maximum payload size #2081
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -1148,14 +1148,14 @@ public override NetcodeNetworkEvent PollEvent(out ulong clientId, out ArraySegme | |||
/// <param name="networkDelivery">The delivery type (QoS) to send data with</param> | |||
public override void Send(ulong clientId, ArraySegment<byte> payload, NetworkDelivery networkDelivery) | |||
{ | |||
if (payload.Count > m_MaxPayloadSize) | |||
var pipeline = SelectSendPipeline(networkDelivery); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😻
YAY
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks awesome to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
…everting MaxPayloadSize to default
* After this PR Unity-Technologies/com.unity.netcode.gameobjects#2081 reverting MaxPayloadSize to default * basis works, still need to debug issue with client reconnecting a second time * setting back max payload size to default value. With recent changes, this now only applies to unreliable messages. With how little NGO uses unreliable messages, this shouldn't need any tweaking anymore. reserializing NetworkingManager, this removes the old max send queue size value as well. * Increasing connection approval timeout to 5 seconds, as 1 second was pretty short for a connection. If there's any packet drops or temporary lag spike, this could timeout the connection when it was actually fine. Still lower than the default 10 seconds. * using classes instead of structs now that we have managed types available in netvars * fixing null ref when doing reconnection flow * deprecated note for utilities * updating manifest and dependencies with 1.1.0 now it's released * initializing number of reconnect attempts before starting the reconnect coroutine * fixing player prefab being destroyed issue Co-authored-by: Unity Netcode CI <[email protected]> Co-authored-by: LPLafontaineB <[email protected]>
…hnologies#2081) * feat: Allow reliable sends to go over maximum payload size
The 'Max Payload Size' setting in
UnityTransport
determines the largest payload that can be sent in a singleSend
call. Internally, we use this value to configure the fragmentation limit in UTP's fragmentation pipeline stage. This pipeline stage is only used for unreliable traffic, though. Fragmentation of reliable traffic is done directly in the send/receive queues insideUnityTransport
.So technically, reliable payload size is not bound by that 'Max Payload Size' limit (it's bound by 'Max Send Queue Size' instead). Still,
UnityTransport.Send
would reject reliable sends larger than 'Max Payload Size' to remain consistent with the unreliable behavior. This PR changes this behavior and now allows reliable sends to go over the configured maximum payload size.The reason for this change is that it's now apparent (from browsing Discord and the forums) that tweaking this maximum payload size limit is a source of friction for users. Since most traffic in NGO is reliable, this PR will make it look to most users as if the limit doesn't exist. (Remains the issue of having to tweak the 'Max Send Queue Size', but solving that is a bit more complicated.)
Changelog
UnityTransport
, reliable payloads are now allowed to exceed the configured 'Max Payload Size'. Unreliable payloads remain bounded by this setting.Testing and Documentation