multicast

Does Java NIO support broadcast or multicast?

旧城冷巷雨未停 提交于 2019-12-22 09:39:55
问题 I am searching if Java NIO implements broadcast. I need to create a peer that sends messages to other peers, using multicast or broadcast. I was searching in the API 1.6, but I don't find anything in the DatagramChannel class. Thanks in advance. 回答1: NIO2 supports multicast, that's in Java 7. http://javanio.info/filearea/nioserver/WhatsNewNIO2.pdf 回答2: Before NIO2 you have to make use of all kinds of hacks to make a datagram channel join a multicast group. Not sure how they could have left

C# SocketException with Multicast on XP

Deadly 提交于 2019-12-22 05:53:26
问题 The following C# code works correctly on Vista, but fails on XP with: SocketException: An invalid argument was supplied. The ErrorCode is 10022. The firewall on XP has been disabled. using System; using System.Net; using System.Net.Sockets; public class SocketTest { [STAThread] public static void Main() { MySocket s = new MySocket(); Console.WriteLine("done"); Console.ReadLine(); } public class MySocket : Socket { public const ushort SocketTtl = 4; public const string Address = "239.255.255

Why DatagramSocket.joinGroup() method takes a SocketAddress if the port does not matter for a multicast group?

柔情痞子 提交于 2019-12-22 05:48:13
问题 I am just curious. Is that an API mistake? When you join a multicast group you do NOT use the port, just the multicast address (IP) which is the multicast group, right? Is that an annoyance of is there ever the case when the PORT will be used? 回答1: The question would be better reformulated as 'why does DatagramSocket.joinGroup() take a SocketAddress parameter, which can contain a port number?' The port number in the SocketAddress is ignored. Multicast is defined entirely in terms of IP

Android udp multicast with Ethernet

末鹿安然 提交于 2019-12-21 19:58:20
问题 Hello everyone, I'm working on a project with udp multicast. I have a server sending multicast udp packets via an ethernet cable. I have spent weeks of work reading all the posts about multicast on android and I still can't receive any udp packet on my Asus Transformer Tablet, 4.1. For some reasons, I can't put my code here, I will try to explain it carefully. I have a simple MainActivity displaying some stuff. Almost everything is n the Oncreate method, and so is the line where I call a

Link-scope IPv6 Multicast packets suddenly not routable on a MacBook Pro?

烈酒焚心 提交于 2019-12-21 19:05:42
问题 This is a slightly obscure question, but I'm stumped and I thought maybe somebody out there might have more of a clue on the issue. My co-worker has been successfully running an in-house application that uses IPv6 multicasting on his MacBook Pro for several months, but today the Mac decided to stop routing the multicast packets. In particular, the program prints this error: SendDataUDP(ff02::bead:cede:deed:feed@4) failed on Network interface [Name=[en0] Description=[] IP=[fe80::222:41ff:fe21

C++ multiple multicast receiver with boost asio

拥有回忆 提交于 2019-12-21 06:29:24
问题 I have to implement a multicast receiver able to join a list of multicast groups and process received data in a specific thread using boost. I did try the following code..... boost::asio::io_service m_io_service; boost::asio::ip::udp::socket m_multicast_socket(m_io_service); // listen address boost::asio::ip::address listen_address = boost::asio::ip::address::from_string("0.0.0.0"); // listen port unsigned short multicast_port = m_configuration->m_multicast_interface_port; boost::asio::ip:

C++ multiple multicast receiver with boost asio

梦想与她 提交于 2019-12-21 06:29:02
问题 I have to implement a multicast receiver able to join a list of multicast groups and process received data in a specific thread using boost. I did try the following code..... boost::asio::io_service m_io_service; boost::asio::ip::udp::socket m_multicast_socket(m_io_service); // listen address boost::asio::ip::address listen_address = boost::asio::ip::address::from_string("0.0.0.0"); // listen port unsigned short multicast_port = m_configuration->m_multicast_interface_port; boost::asio::ip:

Netlink Multicast Kernel Group

泪湿孤枕 提交于 2019-12-21 05:41:32
问题 The task I am trying to achieve is actually quite simple (multicast the string "TEST" to a userland daemon), but the kernel module doesn't compile. It stops with the error: passing argument 4 of ‘genlmsg_multicast_allns’ makes integer from pointer without a cast [enabled by default] But shouldn't it just be the multicast group I defined? Here is the code for "clarification": #include <linux/module.h> #include <net/sock.h> #include <linux/netlink.h> #include <linux/skbuff.h> #include <linux

Android can not receive multicast packet

梦想与她 提交于 2019-12-21 02:46:14
问题 I'm playing a little bit with multicast sockets. I write a server which sends a message to a android client. Until yet the client should only log the received message. I noticed that no multicast packet are received on my device. Here is the code for the server (runs on the pc): public class MulticastServer{ private int port; private boolean running = false; private MulticastSocket serverSocket; private InetAddress group; private String multicastAddress = "230.192.0.11"; public

Boost asio socket multicast to a specific ethernet interface

南楼画角 提交于 2019-12-21 02:02:13
问题 I thought I had found the answer in the following example, but not quite. boost::asio::ip::udp::socket socket(io_service); ... boost::asio::ip::address_v4 local_interface = boost::asio::ip::address_v4::from_string("1.2.3.4"); boost::asio::ip::multicast::outbound_interface option(local_interface); socket.set_option(option); How do I map eth0 to the appropriate outbound_interface option? 回答1: The following code works fine on Windows and Mac OS X: const ip::udp::resolver::query queryIF( ip::udp: