IPv4 发送多播数据包
所有系统都在所需的物理接口上使用主机的 IP:
const socket = dgram.createSocket('udp4');
socket.bind(1234, () => {
socket.setMulticastInterface('10.0.0.2');
});
All systems use an IP of the host on the desired physical interface:
const socket = dgram.createSocket('udp4');
socket.bind(1234, () => {
socket.setMulticastInterface('10.0.0.2');
});