multicastsocket

MulticastSocket constructors and binding to port or SocketAddress

不打扰是莪最后的温柔 提交于 2019-12-04 05:07:45
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 following (client) code which works ok, I can multicast a packet to it without the Multicast socket timing

How to minimize UDP packet loss

醉酒当歌 提交于 2019-12-03 16:09:37
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): (java.net.MulticastSocket)socket.setReceiveBufferSize(32*1024); That change increased the number of

Problem with MulticastSocket on Java-Android

只谈情不闲聊 提交于 2019-12-03 13:43:20
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 = InetAddress.getByName("224.2.76.24"); ms = new MulticastSocket(5500); ms.joinGroup(sessAddr); while

Getting `Can't assign requested address` java.net.SocketException using Ehcache multicast

给你一囗甜甜゛ 提交于 2019-12-03 03:03:02
问题 Getting java.net.SocketException when trying to start a multicast provider: 2013-09-11 11:45:44,204 [main] ERROR net.sf.ehcache.distribution.MulticastRMICacheManagerPeerProvider: Error starting heartbeat. Error was: Can't assign requested address java.net.SocketException: Can't assign requested address at java.net.PlainDatagramSocketImpl.join(Native Method) at java.net.AbstractPlainDatagramSocketImpl.join(AbstractPlainDatagramSocketImpl.java:178) at java.net.MulticastSocket.joinGroup

Getting `Can't assign requested address` java.net.SocketException using Ehcache multicast

∥☆過路亽.° 提交于 2019-12-02 17:03:55
Getting java.net.SocketException when trying to start a multicast provider: 2013-09-11 11:45:44,204 [main] ERROR net.sf.ehcache.distribution.MulticastRMICacheManagerPeerProvider: Error starting heartbeat. Error was: Can't assign requested address java.net.SocketException: Can't assign requested address at java.net.PlainDatagramSocketImpl.join(Native Method) at java.net.AbstractPlainDatagramSocketImpl.join(AbstractPlainDatagramSocketImpl.java:178) at java.net.MulticastSocket.joinGroup(MulticastSocket.java:319) at net.sf.ehcache.distribution.MulticastKeepaliveHeartbeatReceiver.init

IPv6 Multicast example

。_饼干妹妹 提交于 2019-12-02 04:12:20
问题 I've searched for examples of how to implement a simple ipv6 multicast example, however I have only found examples using ipv4. Can anybody provide a simple "helloworld" example of ipv6 multicasting? 回答1: Here is a simple client server example. Incidentally running it on multiple machines on a network wil get all the machines chatting to each other, good for testing automatic discovery on the network. import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress;

IPv6 Multicast example

风格不统一 提交于 2019-12-02 02:30:35
I've searched for examples of how to implement a simple ipv6 multicast example, however I have only found examples using ipv4. Can anybody provide a simple "helloworld" example of ipv6 multicasting? Here is a simple client server example. Incidentally running it on multiple machines on a network wil get all the machines chatting to each other, good for testing automatic discovery on the network. import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; import java.net.MulticastSocket; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class

Help with Sending/ Receiving UDP packets - C Sockets

喜夏-厌秋 提交于 2019-12-01 22:55:58
问题 Ok, if you look at some of my previous questions, I've been working on getting a simple connection up and running with C sockets (I'm still fairly new to the whole networking aspect of an program, but everyone has to start somewhere, right?). I've included the code below that I have so far and when I execute it, I get no errors, but at the same time, I don't get the packet on the other end. By the way, I'm programming multicast sockets in objective-C and "msgStatus" is just a label in my GUI

Is Java MulticastSocket threadsafe?

萝らか妹 提交于 2019-11-29 07:13:22
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? Boris Pavlović Both send and receive DatagramSocket methods are synchronized on the sending/receiving datagram packet. In other words if you are using a same datagram packet to send and receive from two different threads these two