socket.dropMembership(multicastAddress[, multicastInterface])


指示内核使用 IP_DROP_MEMBERSHIP 套接字选项离开 multicastAddress 的组。当套接字关闭或进程终止时,内核会自动调用此方法,因此大多数应用通常没有理由调用它。

【Instructs the kernel to leave a multicast group at multicastAddress using the IP_DROP_MEMBERSHIP socket option. This method is automatically called by the kernel when the socket is closed or the process terminates, so most apps will never have reason to call this.】

如果未指定 multicastInterface,操作系统将尝试在所有有效接口上取消加入组。

【If multicastInterface is not specified, the operating system will attempt to drop membership on all valid interfaces.】