# UDPSocket.onMessage(function callback)

Listens on the event of receiving messages.

# Parameters

# function callback

The callback function for the event of receiving messages.

# Parameters

# Object res
Property Type Description
message ArrayBuffer Received messages
remoteInfo Object Structured information of message sources

remoteInfo is composed as follows

Property Type Description
address string The address of the socket sending the message
family string The protocol family used, IPv4 or IPv6
port number Port number
size number The message size, in bytes
点击咨询小助手