multicast

How to use GCDAsyncUdpSocket for multicast over wifi and bluetooth

我只是一个虾纸丫 提交于 2019-11-30 10:32:30
I am currently using GCDAsyncUdpSocket to send multicast datagrams over wifi between iOS devices. The Code is pretty simple.. Client self.socket = [[GCDAsyncUdpSocket alloc] initWithDelegate:self delegateQueue:dispatch_get_main_queue()]; //omitted error checking [self.socket bindToPort:12345 error:&err]; [self.socket joinMulticastGroup:@"224.0.1.1" error:&err]; [self.socket beginReceiving:&err]; Server self.multicastSocket = [[GCDAsyncUdpSocket alloc] initWithDelegate:self delegateQueue:dispatch_get_main_queue()]; NSData *d = [@"hello" dataUsingEncoding:NSUTF8StringEncoding]; [self

UDP: Listening to the same port for two different multicast streams

血红的双手。 提交于 2019-11-30 09:53:58
I need to listen to 2 different multicast groups using the same port. Program A will listen from 230.0.0.1 and Program B from 230.0.0.2 . Both multicast groups use the same port 2000 and I have no control over it. When I run my programs I receive both multicast streams in each program, that is both the data packets broadcasted on 230.0.0.1 and 230.0.0.2 . I suspect the problem is due to the common port. This is the code I am using to subscribe to the multicast: if( (sd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0 ) { perror("socket"); return -1; } if( setsockopt(sd, SOL_SOCKET, SO_REUSEADDR

Why does multicast reception not work on some Android devices?

五迷三道 提交于 2019-11-30 09:10:56
It seems multicast reception does not work on some Android devices. I can not receive multicast with 4 out of 13 test devices. On those 4 devices it seems the app does not send the IGMP request to join the multicast group. The code to receive the multicast looks like so: WifiManager wifiManager = (WifiManager)context.getSystemService(Context.WIFI_SERVICE); WifiManager.WifiLock wifiLock = wifiManager.createWifiLock(WifiManager.WIFI_MODE_FULL_HIGH_PERF, TAG); WifiManager.MulticastLock multicastLock = wifiManager.createMulticastLock(TAG); multicastLock.setReferenceCounted(true); wifiLock.acquire(

Erlang Multicast

守給你的承諾、 提交于 2019-11-30 05:05:08
How do you use gen_udp in Erlang to do multicasting? I know its in the code, there is just no documentation behind it. Sending out data is obvious and simple. I was wondering on how to add memberships. Not only adding memberships at start-up, but adding memberships while running would be useful too. Here is example code on how to listen in on Bonjour / Zeroconf traffic. -module(zcclient). -export([open/2,start/0]). -export([stop/1,receiver/0]). open(Addr,Port) -> {ok,S} = gen_udp:open(Port,[{reuseaddr,true}, {ip,Addr}, {multicast_ttl,4}, {multicast_loop,false}, binary]), inet:setopts(S,[{add

How to set up a socket for UDP multicast with 2 network cards present?

萝らか妹 提交于 2019-11-30 05:03:15
I'm trying to get udp multicast data using sockets and c++ (c). I have a server with 2 network cards so I need to bind socket to specific interface. Currently I'm testing on another server that has only one network card. When I use INADDR_ANY I can see the udp data, when I bind to specific interface I don't see any data. Function inet_addr is not failing (I removed checking for return value for now). Code is below. On a server with one network card, my IP address is 10.81.128.44. I receive data when I run as: ./client 225.0.0.37 12346 This gives me no data: ./client 225.0.0.37 12346 10.81.128

GCDAsyncUdpSocket on iOS missing multicasted datagrams

我怕爱的太早我们不能终老 提交于 2019-11-30 04:03:18
I have a device on the network that is multicasting a very small file via UDP. The iOS app I am developing is responsible for reading these packets and I have chosen to use GCDAsyncUdpSocket to do so. The file is sent every half second, however I am not receiving it nearly that often (only receiving about every 3-10 seconds). Thinking that it may be an issue with the device, I began monitoring the traffic with Wireshark. This appeared to reflect what I was seeing in my app until I enabled "Monitor Mode" in Wireshark, at which point every UDP packet was being captured. In addition, the iOS

Is there a way to test multicast IP on same box?

雨燕双飞 提交于 2019-11-30 02:41:36
If I want to test a set of multicast IP programs (sender/receiver) without having to set up the networking, can this be done on the same box? If so, what needs to be setup or done differently? You may have figured this out already (since the question is now 2 years old) but to do multicast on a single host, you only have to do two things: (1) make sure that your receiving multicast sockets have SO_REUSEADDR set (so that multiple processes can bind the same multicast address) and (2) make sure your sending multicast sockets have IP_MULTICAST_LOOP set (so that packets will be "looped back" to

Send Broadcast datagram

点点圈 提交于 2019-11-30 01:12:49
I need to send a broadcast datagram to all machine (servers) connected to my network. I'm using NodeJS Multicast Client var dgram = require('dgram'); var message = new Buffer("Some bytes"); var client = dgram.createSocket("udp4"); client.send(message, 0, message.length, 41234, "localhost"); // If I'm in the same machine 'localhost' works // I need to do something 192.168.0.255 or 255.255.255 client.close(); Servers var dgram = require("dgram"); var server = dgram.createSocket("udp4"); server.on("message", function (msg, rinfo) { console.log("server got: " + msg + " from " + rinfo.address + ":"

UDP packet drops by linux kernel

跟風遠走 提交于 2019-11-29 22:06:13
问题 I have a server which sends UDP packets via multicast and a number of clients which are listing to those multicast packets. Each packet has a fixed size of 1040 Bytes, the whole data size which is sent by the server is 3GByte. My environment is follows: 1 Gbit Ethernet Network 40 Nodes, 1 Sender Node and 39 receiver Nodes. All Nodes have the same hardware configuration: 2 AMD CPUs, each CPU has 2 Cores @2,6GHz On the client side, one thread reads the socket and put the data into a queue. One

How do I choose a multicast address for my application's use?

孤人 提交于 2019-11-29 18:56:29
How should I choose an IPv4 multicast address for my application's use? I may need more than one (a whole range perhaps ultimately) but just want to avoid conflicts with other applications. Packets will be entirely contained within an administrative domain, probably a LAN If several independent instances of my application are in use on the same network, they could each use their own multicast address - but if they don't, they will be able to coexist anyway, they'll just have a small amount of overhead ignoring each others' packets. My packets already contain a "magic number" to avoid problems