Hi,
I want to encode the PNG of one client to the server. I tried sending the encoded PNG using Command on both channel 0 and 1 but I get an error message saying these channel have MTU size of 1500 and message cannot be fragmented.
I tried LLAPI along with HLAPI to open a separate port at LLAPI but I am getting an error saying that only one NetworkManager is allowed in the scene.
What is the best way to send a message which is 50,000 bytes using HLAPI?
I understand I have to add an Unreliable channel to my ConnectionConfig but I am not able to figure out how to get access to current ConnectionConfig in NetworkBehavior.
I have added one extra channel in NetworkManager’s advanced configuration. But this chanlle #2 is not visible in NetworkBehavior if I send a Command on Channel 2.
I also tried changing the Channel#1 to Unreliable Fragmented but it gives an error message
“no free events for long message”.
Since the size is large(and important) you need to use ReliableFragmented ,break the data up in smaller byte arrays and reassemble the data at the receiving end.
The data is not important. I am looking for a sample to do this since I have not been able to find what does Unity APIs expect me to do do to send data on Fragmented channel.
Also my understanding from blog is that I don’t have to fragment and reassemble the message. Unity will take care of it if I use Fragmented channel.
The script has some data which needs to go on reliable channel but data for screen capture should go on unreliable fragmented channel.
I don’t expect my data to be lost on Local wifi so I changed the script as per above suggestion to send all the data on channel 2. But even sending 2764 byte[ ] array, I get an error “no free events for long message”
My understanding is that UnreliableFragmented can support MTU*32 size packets. I have read recommendations in the link but I am still not sure why 2764 bytes packets are not being sent.
“no free events” means that the channel’s packet queue is full, not that the MTU was exceeded. You are sending packets at a rate the the network cannot handle.
Got it. We were using our own C++ plugin over raw socket to send the data captured earlier. We wanted to move to Unity networking so we don’t have to maintain native code for different platform.
For now we will keep using the native code plugin till we have better understanding of Unity networking and how we can send large data per frame.