Receives a UDP datagram as a string.
Takes a handle (Int) and maximum size (Int).
Returns the received datagram as a string, or empty string if no datagram available (String).
Network
Parameters & Returns
Parameters
handleInt
maxSizeInt
Returns
String
Quick Summary
Receives a UDP datagram as a string.
Takes a handle (Int) and maximum size (Int).
Returns the received datagram as a string, or empty string if no datagram available (String).
Technical Exegesis...
Convenience function that receives a UDP datagram and returns it as a null-terminated string. Allocates a temporary buffer of maxSize+1 bytes, receives up to maxSize bytes using netRecvUDPMsg, null-terminates the result, and returns the string. Returns an empty string if no datagram is available.
If maxSize is <= 0, defaults to 1024 bytes. The buffer is automatically freed after copying to the return string. Updates sender info accessible via netUDPMsgIP and netUDPMsgPort.
Convenience function that receives a UDP datagram and returns it as a null-terminated string. Allocates a temporary buffer of maxSize+1 bytes, receives up to maxSize bytes using netRecvUDPMsg, null-terminates the result, and returns the string. Returns an empty string if no datagram is available.
If maxSize is <= 0, defaults to 1024 bytes. The buffer is automatically freed after copying to the return string. Updates sender info accessible via netUDPMsgIP and netUDPMsgPort. Wrapper around netRecvUDPMsg for easier string reception. Useful for text-based messaging over UDP.