事件:'message'


【Event: 'message'

'message' 事件在套接字上有新的数据报可用时触发。事件处理函数会收到两个参数:msgrinfo

【The 'message' event is emitted when a new datagram is available on a socket. The event handler function is passed two arguments: msg and rinfo.】

如果传入数据包的源地址是 IPv6 链路本地地址,则接口名称会被添加到 address 中。例如,在 en0 接口上接收到的数据包,其地址字段可能会被设置为 'fe80::2618:1234:ab11:3b9c%en0',其中 '%en0' 是作为区域 ID 后缀的接口名称。

【If the source address of the incoming packet is an IPv6 link-local address, the interface name is added to the address. For example, a packet received on the en0 interface might have the address field set to 'fe80::2618:1234:ab11:3b9c%en0', where '%en0' is the interface name as a zone ID suffix.】