multicast

GCDAsyncUdpSocket on iOS missing multicasted datagrams

老子叫甜甜 提交于 2019-12-18 11:44:34
问题 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

How do I determine the source IP of a multicast packet in C#?

耗尽温柔 提交于 2019-12-18 04:52:55
问题 I need to determine the IP of a machine that has sent me a multicast packet, so that I can respond to it via unicast. I'm using the following csharp (.Net 3.5) code to receive the packets over a multicast connection (code has been edited for brevity, with error checking and irrelevant options removed): IPEndPoint LocalHostIPEnd = new IPEndPoint(IPAddress.Any, 8623); Socket UDPSocket = new Socket(AddressFamily.InterNetwork,SocketType.Dgram,ProtocolType.Udp); UDPSocket.SetSocketOption

Multicast - no such device

此生再无相见时 提交于 2019-12-17 19:36:32
问题 I am trying to connect to a multicast group using the following piece of code: int flag_on = 1; /* socket option flag */ struct sockaddr_in mc_addr; /* socket address structure */ char recv_str[MAX_LEN+1]; /* buffer to receive string */ int recv_len; /* length of string received */ char* mc_addr_str; /* multicast IP address */ unsigned short mc_port; /* multicast port */ struct sockaddr_in from_addr; /* packet source */ unsigned int from_len; /* source addr length */ mc_addr_str = ip; /* arg

How do you UDP multicast in Python?

元气小坏坏 提交于 2019-12-17 02:04:33
问题 How do you send and receive UDP multicast in Python? Is there a standard library to do so? 回答1: This works for me: Receive import socket import struct MCAST_GRP = '224.1.1.1' MCAST_PORT = 5007 IS_ALL_GROUPS = True sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP) sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) if IS_ALL_GROUPS: # on this port, receives ALL multicast groups sock.bind(('', MCAST_PORT)) else: # on this port, listen ONLY to MCAST_GRP sock.bind

Boost UDP multicast receiver: set_option: The requested address is not valid in its context

为君一笑 提交于 2019-12-14 03:25:09
问题 I am following Boost's UDP Time server tutorial here . I modify the code with these for predefined values: short multicast_port = 13; // (in class receiver) and in main(): //if (argc != 3) and the code for argv that follows are commented out receiver r(io_context, boost::asio::ip::make_address("127.0.0.1"), boost::asio::ip::make_address("127.0.0.1")); // This error is thrown: set_option: The requested address is not valid in its context I have tried "0.0.0.0" and "127.0.0.1" and other values.

ZeroMQ PUB/SUB with epgm not able to receive messages sent by process on the same host

我怕爱的太早我们不能终老 提交于 2019-12-13 14:52:04
问题 All my processes have two sockets, one PUB and one SUB, and they all use the same multicast address and port. For example, PUB will do this: bind("epgm://239.192.1.1:5555") SUB will do this: connect("epgm://239.192.1.1:5555") setsockopt(ZMQ_SUBSCRIBE, "", 0); //subscribe everything PUB will then send message by calling zmq_send, and SUB will receive by calling zmq_poll and do Nonblocking zmq_recv. It works perfectly fine when I run two processes on two different hosts. But if I run them on

Get Multicast Dest from Python Socket Recv

狂风中的少年 提交于 2019-12-13 03:49:13
问题 For my project, I need some way to know which multicast group a packet was originally sent to when it's received by my client. I've considered maintaining a map of sockets to multicast groups and identifying them this way, but surely there's some way to get the address from the datagram? To listen, I'm currently using: # Initialise socket for IPv6 datagrams sock = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM, socket.IPPROTO_UDP) # Allows address to be reused sock.setsockopt(socket.SOL

java multiple threads taking turn

给你一囗甜甜゛ 提交于 2019-12-13 03:37:10
问题 I have 2 java threads receiving UDP multicast. Each thread will receive UDP packets from different multicast streams of say around 60 Mbps, then processes UDP packets and queues in shared BlockingQueue . UDP packets are of around 1300 bytes. I want order of processed UDP packets in queue, which is same as how packets reached to NIC of machine, even if receiving packets from different threads(different multicast streams). I am not able to achieve this in these threads, that is my problem. Is

Apache camel multicast FreeMarker

為{幸葍}努か 提交于 2019-12-13 02:25:30
问题 I need to send two different XMLs (by FreeMarker) to two different endpoints. i.e. .to("freemarker:templates/xml1.ftl").to("file://C:\\testXmls1") and .to("freemarker:templates/xml2.ftl").to("file://C:\\testXmls2") I had a look at the multicast() function but I don't know how to apply it when there are two .to Could anyone please help me? 回答1: Yes you can specify multiple endpoints in the same .to(uri1, uri2, ...) then it becomes as a single "eip". multicast() .to(uri1a, uri1b) .to(uri2a,

Multicast receiver unable to capture the data

断了今生、忘了曾经 提交于 2019-12-12 22:33:48
问题 I want to capture network traffic on specific Multicast IP address and port number. For testing purpose, I replay pcap file over a network on 225.1.1.7 ip and 3100 port. I tried to capture using tcpdump using below command - sudo tcpdump -i eno1 -s0 -vv host 225.1.1.7 and port 3100 and it is working file. I have below java program - class Temp { public static void main(String[] args) throws UnknownHostException, IOException { int port = 3100; String group = "225.1.1.7"; MulticastSocket s =