I am working on a Unity project in which I need both a video- and audio stream running.
I am (perhaps foolishly?) using the HLAPI networking system for this, but it seems that I always fill up the outgoing queue for network messages, and I very quickly get the warning “no free events for long message” (followed by an error: “Failed to send big message”), causing a large part of following messages to not being send or received - this also often causes the client to gets disconnected.
I have tried messing around with the ConnectionConfig when creating NetworkClients, but have not found any values that help with the problem.
I am using both the Qos-Unreliable channel (for audio etc.) and Qos-UnreliableFragmented (for video).
I am trying to send a video-image (~20 KB) 10-30 times a second.
Is there anyway to empty the queue of outgoing messages?
Is there some configuration-values that I should use to make this possible?
Or should I use the LLAPI system (or .NET sockets maybe?) instead?
Allright, I figured out how to partly solve the problem…: I needed to change the maximum packet size, which is only configurable when initializing “NetworkTransport” (LLAPI) - i.e. calling NetworkTransport.Init().
So, before initializing any part of the network, I create a GlobalConfiguration with MaxPacketSize = 65000 and call NetworkTransport.Init() with the GlobalConfiguration as parameter.
I still get the error if the network bandwidth is too low for the messages, however.
Don’t know if you’re still interested in replies to this, but I came across it in google so thought I’d add some info.
Be careful setting a max packet size beyond 1500. It’s beyond MTU, which is a standard you might not want to exceed (your packets might not be processed on the internet).
Look into connectionConfig.MaxSentMessageQueueSize instead, which will raise the limit you’re hitting (how many messages can be queued for sending at a time).
A fragmented channel is still bound by the MTU of ~1400 bytes, it just fragments each larger user message into many protocols message inside the LLAPI.
20K x 30 = 600K bytes.
600K / 1400 = about 428 message per second.
I don’t think the LLAPI can handle that amount of throughput. I’d suggest trying to keep the throughput below 100 msgs per second.