-
Notifications
You must be signed in to change notification settings - Fork 457
feat: Add methods for setting max message size limits (i.e., MTU negotiation) [MTT-6214] #2530
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0xFA11
reviewed
Apr 27, 2023
com.unity.netcode.gameobjects/Runtime/Messaging/NetworkMessageManager.cs
Outdated
Show resolved
Hide resolved
0xFA11
reviewed
Apr 27, 2023
Comment on lines
583
to
596
/// <summary> | ||
/// Sets the maximum size of a single non-fragmented message (or message batch) passed through the transport. | ||
/// This should represent the transport's MTU size, minus any transport-level overhead. | ||
/// </summary> | ||
/// <param name="size"></param> | ||
public void SetMaxSingleMessageSize(int size) => MessageManager.SetMaxSingleMessageSize(size); | ||
|
||
/// <summary> | ||
/// Sets the maximum size of a message (or message batch) passed through the transport with the ReliableFragmented delivery. | ||
/// Warning: setting this value too low may result in the SDK becoming non-functional with projects that have a large number of NetworkBehaviours or NetworkVariables, as the SDK relies on the transport's ability to fragment some messages when they grow beyond the MTU size. | ||
/// </summary> | ||
/// <param name="size"></param> | ||
public void SetMaxFragmentedMessageSize(int size) => MessageManager.SetMaxFragmentedMessageSize(size); | ||
|
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.
2 things:
- I'd suggest
get; set;
property here (so that users could get the value without setting it) - I'd suggest naming these APIs as
int MaximumTransmissionUnitSize { get; set; }
&int MaximumFragmentedMessageSize { get; set; }
because it looks like they boil down to those two concepts.
Co-authored-by: Fatih Mar <[email protected]>
NoelStephensUnity
approved these changes
May 23, 2023
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!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds new APIs. Do not merge until after the release/1.4.1 branch has been created.
resolves #2431
Changelog
NetworkManager.SetMaxSingleMessageSize()
andNetworkManager.SetMaxFragmentedMessageSize()
for transports that don't work with the default valuesTesting and Documentation