netRecvUDPString

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

handle Int
maxSize Int

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.

Example

Example.bam
; No example implemented yet