Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feature Request [1.2.0-exp.3] CommandSendSystem Should Use MaxMessageSize Parameter Instead of Hardcoded MTU

Discussion in 'NetCode for ECS' started by Kmsxkuse, Nov 17, 2023.

  1. Kmsxkuse

    Kmsxkuse

    Joined:
    Feb 15, 2019
    Posts:
    304
    Newly introduced in Transport 2.1 is the maxMessageSize parameter found on NetworkSettings, a customizable max packet size for restricting the size of packets other than 1400 bytes what was previously hardcoded into NetworkParameterConstants.MTU.

    Netcode's CommandSendSystem does not yet recognize MaxMessageSize so changing this value will cause the send system to break.

    Please change CommandSendSystem (specifically line 181) to instead use the MaxMessageSize parameter on the driver's NetworkSettings.

    ~~~~~~~~~~~~~~~~~~~

    Just in case anyone stumbles upon an error caused by reducing the max message size and googles it:

    Failed to send a snapshot to a client with BeginSend error: -4!
     
  2. CMarastoni

    CMarastoni

    Unity Technologies

    Joined:
    Mar 18, 2020
    Posts:
    873
    this is good point! Thanks for the suggestion.
     
    te_headfirst, Shinyclef and Kmsxkuse like this.
  3. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    497
    Can I add that there are several places in Netcode that use MTU constant that might need to be reviewed to look at MaxMessageSize. I'm sure you know this already ^^. FYI just in case.

    upload_2023-11-18_12-39-2.png
     
  4. michal_chrobot

    michal_chrobot

    Unity Technologies

    Joined:
    Mar 14, 2023
    Posts:
    2
    Hey, we are on it. I will keep you updated about the progress
     
    te_headfirst, Shinyclef and Kmsxkuse like this.