A Java application transmits data over UDP in Multicast mode with another computer. VirtualBox is installed on the same machine.
Here is the code for sending data:
private final static String IP_ADDR = "224.1.1.201";
DatagramSocket socket;
public void sending() {
socket = new DatagramSocket();
group = InetAddress.getByName(IP_ADDR);
sendingDataBuffer = parserData(dataBuffer);
DatagramPacket packet
= new DatagramPacket(sendingDataBuffer, sendingDataBuffer.length, group, SERVICE_PORT);
socket.send(packet);
}
The problem turned out to be that the program was sending packets to the VirtualBox network, so I could neither receive them on the receiving side nor see them in Wireshark. How can I specify in the Java code which network to send packets to? If I disconnect the VirtualBox network connection, then packets start to be sent via a standard network connection to another computer.
Why is my app sending data to this particular network?