There is only scant mention of UDP::receivePacket() in the docs. It should have its own sub-section such as parsePacket() does.
I noticed this because of @rickkas7’s very useful code snippet that allows UDP reception to continue when Particle Cloud connection is lost or non-existent.
// receivePacket() is preferable to parsePacket()/read() because it saves a buffering step but more importantly
// it returns an error code if an error occurs!
// This is important to reinitialize the listener on error.