Probably won't matter much in a real world use case since STUN packets are so small, but it is possible that the supplied buffer doesn't contain all necessary bytes yet and needs to be called repeatedly until a complete packet can be decoded.
I would propose doing the StunPacket decoding process outside of the client or provide the client with an additional state that waits for more input.
Probably won't matter much in a real world use case since STUN packets are so small, but it is possible that the supplied buffer doesn't contain all necessary bytes yet and needs to be called repeatedly until a complete packet can be decoded.
I would propose doing the StunPacket decoding process outside of the client or provide the client with an additional state that waits for more input.