socket.addSourceSpecificMembership(sourceAddress, groupAddress[, multicastInterface])
告诉内核在给定的 sourceAddress 和 groupAddress 上加入源特定组播通道,使用 multicastInterface 和 IP_ADD_SOURCE_MEMBERSHIP 套接字选项。如果未指定 multicastInterface 参数,操作系统将选择一个接口并向其添加组成员。要向每个可用接口添加组成员,请多次调用 socket.addSourceSpecificMembership(),每个接口调用一次。
【Tells the kernel to join a source-specific multicast channel at the given
sourceAddress and groupAddress, using the multicastInterface with the
IP_ADD_SOURCE_MEMBERSHIP socket option. If the multicastInterface argument
is not specified, the operating system will choose one interface and will add
membership to it. To add membership to every available interface, call
socket.addSourceSpecificMembership() multiple times, once per interface.】
当在未绑定的套接字上调用此方法时,它将隐式绑定到一个随机端口,并监听所有接口。
【When called on an unbound socket, this method will implicitly bind to a random port, listening on all interfaces.】