mikerochip/unity-websocket

No error message when receiving message bigger than MaxReceiveBytes

Closed this issue · 2 comments

korbul commented

Hey @mikerochip , thanks for the great lib.

In my use case I happened to receive messages larger than the default of 4096 bytes. There was no error message even though I was listening on ErrorMessageReceived. Looking at the code it seems it is silently consuming the whole message if it's bigger than the max. Logging a message would be a good idea here, to give users a heads up something is amiss. I was missing some messages I was supposed to receive and that's how I stumbled upon this.

Hi @korbul, thanks for bringing this up, and seems reasonable to trigger the ErrorMessageReceived event for this case. Will put in a fix for that.

Definitely not going to Debug.Log anything... logging from a library is really poor form. I'm breaking my own rule in the .jslib and I don't feel good about it!

Welp, I realized while fixing this issue that outgoing messages already triggered an error on send size exceeded, so I added a similarly worded error for receive size exceeded.

Should be fixed now in Release 1.1.6