- Home /
NetworkTransport.Receive: how to drop an invalid message that is too long
When using NetworkTransport.Receive and NetworkTransport.ReceiveFromHost if the next event is a DataEvent we must provide a buffer that is large enough to accomodate the message. Otherwise the function returns with the error MessageTooLong and the offending message remains in the event queue. This is all well and nice if you are dynamically allocating your local buffer and want another chance to read the message. But what if the message in the input buffer is too large simply because it's invalid? We can tell because the output parameter receivedSize comes assigned to. Is there a way to drop the message without having to allocate a larger buffer than the application protocol would have needed ?
Your answer
Follow this Question
Related Questions
Unity networking tutorial? 6 Answers
NetworkServer.dontListen not working - How do I stop clients connecting? 2 Answers
Cannot get objects to appear on client screen using new network system on Android wifi 0 Answers
Networking with a modem, without connecting to a server... Is it possible, are there any examples? 1 Answer
NetworkServer.spawn NOT WORKING! 0 Answers