multicast

What is the purpose and result of using INADDR_ANY?

无人久伴 提交于 2021-02-19 01:26:10
问题 In Python when we want to make a script that listens for multicast traffic we set the IP_ADD_MEMBERSHIP option of the socket with a value that consists of the multicast group address and the address of a local interface on which it will listen for the group's traffic. Many examples on the Internet pass to IP_ADD_MEMBERSHIP the INADDR_ANY wildcard address as the local interface, and some of them state that this will make the socket to listen on all interfaces for multicast packets. However the

Nullpointer exception when trying to receive UDP multicast

只愿长相守 提交于 2021-02-09 07:01:38
问题 i'm puzzeled after a few attempts to get a simple UDP multicast receiver working. After my own code did not work as expected i tried out the exact example posted in the vertx documentation: DatagramSocket socket = vertx.createDatagramSocket(new DatagramSocketOptions()); socket.listen(1234, "0.0.0.0", asyncResult -> { if (asyncResult.succeeded()) { socket.handler(packet -> { // Do something with the packet }); // join the multicast group socket.listenMulticastGroup("230.0.0.1", asyncResult2 ->

In Golang, how to receive multicast packets with socket bound to specific address/port?

时光总嘲笑我的痴心妄想 提交于 2021-02-07 09:07:07
问题 Task at hand is to bind a socket specifically to address 1.0.0.2:520 (assigned to eth2), then read multicast UDP packets addressed to 224.0.0.9:520. I am trying the code below, based on https://godoc.org/golang.org/x/net/ipv4 Unfortunately, result is this debbuging message is never reached: log.Printf("udpReader: recv %d bytes from %s to %s on %s", n, cm.Src, cm.Dst, ifname) I know eth2 is receiving the desired packets because I have this packet sniffer running on it: sudo tcpdump -n -i eth2

In Golang, how to receive multicast packets with socket bound to specific address/port?

只谈情不闲聊 提交于 2021-02-07 09:06:56
问题 Task at hand is to bind a socket specifically to address 1.0.0.2:520 (assigned to eth2), then read multicast UDP packets addressed to 224.0.0.9:520. I am trying the code below, based on https://godoc.org/golang.org/x/net/ipv4 Unfortunately, result is this debbuging message is never reached: log.Printf("udpReader: recv %d bytes from %s to %s on %s", n, cm.Src, cm.Dst, ifname) I know eth2 is receiving the desired packets because I have this packet sniffer running on it: sudo tcpdump -n -i eth2

Hazelcast tcp-ip configuration cluster: Unwanted IPs join the cluster even after cluster-name is specified

泄露秘密 提交于 2021-01-29 06:28:20
问题 I have two hazelcast configure yaml files: hazelcast-cluster1.yml: hazelcast: cluster-name: cluster1 network: join: multicast: enabled:false tip-ip: enabled: true member-list: machineA machineB hazelcast-cluster2.yml: hazelcast: cluster-name: cluster2 network: join: multicast: enabled:false tip-ip: enabled: true member-list: machineC machineD What I wanted is machineA and machineB forms a cluster while machineC and machineD does a separate cluster. However, when I started machineC, it forms a

Hazelcast tcp-ip configuration cluster: Unwanted IPs join the cluster even after cluster-name is specified

孤街浪徒 提交于 2021-01-29 06:26:10
问题 I have two hazelcast configure yaml files: hazelcast-cluster1.yml: hazelcast: cluster-name: cluster1 network: join: multicast: enabled:false tip-ip: enabled: true member-list: machineA machineB hazelcast-cluster2.yml: hazelcast: cluster-name: cluster2 network: join: multicast: enabled:false tip-ip: enabled: true member-list: machineC machineD What I wanted is machineA and machineB forms a cluster while machineC and machineD does a separate cluster. However, when I started machineC, it forms a

How to set IP_MULTICAST_LOOP on multicast UDPConn in Golang

牧云@^-^@ 提交于 2020-12-13 03:43:27
问题 I need to set IP_MULTICAST_LOOP on a multicast UDP connection/socket so I can send/receive multicast packets on my local machine. This is the call that I've found which should work: l, err := net.ListenMulticastUDP("udp4", nil, addr) file, err := l.File() fd := syscall.Handle(file.Fd()) err = syscall.SetsockoptInt(fd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_LOOP, 1) However it fails with "not supported by windows". I'm pretty sure this is supported by sockets in windows, just not in the Go

How to set IP_MULTICAST_LOOP on multicast UDPConn in Golang

瘦欲@ 提交于 2020-12-13 03:42:52
问题 I need to set IP_MULTICAST_LOOP on a multicast UDP connection/socket so I can send/receive multicast packets on my local machine. This is the call that I've found which should work: l, err := net.ListenMulticastUDP("udp4", nil, addr) file, err := l.File() fd := syscall.Handle(file.Fd()) err = syscall.SetsockoptInt(fd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_LOOP, 1) However it fails with "not supported by windows". I'm pretty sure this is supported by sockets in windows, just not in the Go

How to set IP_MULTICAST_LOOP on multicast UDPConn in Golang

只愿长相守 提交于 2020-12-13 03:41:43
问题 I need to set IP_MULTICAST_LOOP on a multicast UDP connection/socket so I can send/receive multicast packets on my local machine. This is the call that I've found which should work: l, err := net.ListenMulticastUDP("udp4", nil, addr) file, err := l.File() fd := syscall.Handle(file.Fd()) err = syscall.SetsockoptInt(fd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_LOOP, 1) However it fails with "not supported by windows". I'm pretty sure this is supported by sockets in windows, just not in the Go

How to set IP_MULTICAST_LOOP on multicast UDPConn in Golang

本小妞迷上赌 提交于 2020-12-13 03:41:05
问题 I need to set IP_MULTICAST_LOOP on a multicast UDP connection/socket so I can send/receive multicast packets on my local machine. This is the call that I've found which should work: l, err := net.ListenMulticastUDP("udp4", nil, addr) file, err := l.File() fd := syscall.Handle(file.Fd()) err = syscall.SetsockoptInt(fd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_LOOP, 1) However it fails with "not supported by windows". I'm pretty sure this is supported by sockets in windows, just not in the Go