multicastsocket

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

Is Java MulticastSocket threadsafe?

随声附和 提交于 2019-12-18 04:54:36
问题 I have two threads. First one sends datagrams with a MulticastSocket in loop; the second thread receives datagrams using the same instance of MulticastSocket in loop. It seems to be working properly, but I'm still in doubts. Can these two threads use the same instance of MulticastSocket? Is MulticastSocket threadsafe in respect send/receive methods invocation? 回答1: Both send and receive DatagramSocket methods are synchronized on the sending/receiving datagram packet. In other words if you are

Multicast : using joinGroup on a multicast socket (java/android) packet isn't received

点点圈 提交于 2019-12-12 19:17:45
问题 I'm developping an android app (using java): i'm trying to send informations between several phones using java MulticastSocket. These phones connect to the same access point when the app is launched, this access point is my computer. This works well because when the app was launched, i can access the internet. But when i'm trying to do the joinGroup on my socket, i get the error : java.net.SocketException: setsockopt failed: ENODEV (No such device) I already did a lot of research about this

How to have two multicast sockets listen to two multicast channels with same port

。_饼干妹妹 提交于 2019-12-08 12:33:13
问题 I have broadly the following multicast socket code. It works fine. Now I need to join two multicast channels on the same machine like 224.10.13.18 - 55001 224.10.13.34 - 55001 and depending on which ip address it came from, I need to treat the message differently. The question is to how to use create two sockets for multicast channels where the port values are same, such that each socket only returns read on data that is sent to that channel. /* create socket to join multicast group on */

MulticastSocket constructors and binding to port or SocketAddress

 ̄綄美尐妖づ 提交于 2019-12-06 01:31:09
问题 I may have a fundamental misunderstanding of the term binding here but I am confused about the usage of the MulticastSocket and it's constructors. They no not do what I understand they should do should do so any who can help me clear my misunderstanding would be appreciated. Firstly what I am trying to achieve. I have tried to write a short program that creates a MulticastSocket bind it (i.e. listen) on a specific network adapter and then join a specific Multicast group. I have tried the

How to minimize UDP packet loss

跟風遠走 提交于 2019-12-05 00:15:16
问题 I am receiving ~3000 UDP packets per second, each of them having a size of ~200bytes. I wrote a java application which listens to those UDP packets and just writes the data to a file. Then the server sends 15000 messages with previously specified rate. After writing to the file it contains only ~3500 messages. Using wireshark I confirmed that all 15000 messages were received by my network interface. After that I tried changing the buffer size of the socket (which was initially 8496bytes):

Problem with MulticastSocket on Java-Android

我的梦境 提交于 2019-12-04 21:00:34
问题 I'm starting to code with MulticastSocket, trying to make a simple app with a client and a server to send messages. The code I have for the server: import java.io.IOException; import java.net.DatagramPacket; import java.net.InetAddress; import java.net.MulticastSocket; import java.net.SocketException; public class Servidor { private static MulticastSocket ms; public static void main(String[] args) throws IOException{ InetAddress sessAddr = InetAddress.getByName("224.2.76.24"); try{ sessAddr =