When using java to receive a Multicast address I get a failed exception.
조회 수: 22 (최근 30일)
이전 댓글 표시
I am trying to receive multicast data in Matlab, but am using Java code because Matlab is unable to receive Multicast data. I am using the following code but when trying to join the group I get an exception.
import java.io.*;
import java.io.DatagramSocket;
import java.io.DatagramPacket;
import java.io.InetAddress;
import java.io.MulticastSocket;
addr = InetAddress.getByName(‘235.1.1.1’);
socket = MulticastSocket(8100);
socket.setSoTimeout(5000);
socket.setReuseAddress(1);
socket.joinGroup(addr);
When I try to join the group I get the following exception.
Java exception occurred: java.net.SocketException: No such device at java.net.PlainDatagramSocketImpl.join(Native Method) at java.net.AbstractPlainDatagramSocketImpl.join(Unknown Source) at java.net.MulticastSocket.joinGroup(Unknown Source)
This code has been pulled from other sources on the web so I feel like something is configured correctly. When I run java –version in Matlab I get Java 1.7.0_60-b19.
I was unable to copy and paste the code, but I think I typed it in correctly so if there is a syntax error that may be why.
This code is run on Red Hat 7.3 and Matlab 2016a.
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Call Java from MATLAB에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!