Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Send more than 1500 bytes in 1 message

Discussion in 'Multiplayer' started by dred, Jul 6, 2015.

  1. dred

    dred

    Joined:
    Apr 8, 2013
    Posts:
    30
    Hello,

    I use MasterServer sample project, and try to sen a huge message with some data (json string) trought network by using NetworkMessage.connection.Send(). What is the best practice to send a huge data from server to clients? Is there any way to increase message size?
     
  2. chrismarch

    chrismarch

    Joined:
    Jul 24, 2013
    Posts:
    470
    You can use the Fragmented channel quality of service options, such as ReliableFragmented, to send your message as multiple packets. You'd set the QoSType in the ConnectionConfig, or using the NetworkManager inspector (check Advanced Configuration). Then, give the correct channel index argument to your send invocation.
     
  3. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    I always just go to http for stuff like this. It's better suited for the job and often simpler and less error prone. You are dealing with a scenario that is an edge case in the UDP world, but a common case in the http world. Plus I believe fragmented messages do have a limit on the number of fragments.