This page last changed on Jun 04, 2014 by or-sbus.

Hi everyone,
I am new and i am working on implementation new protocol.
My protocol need to find it's local broadcast IP address
Eg. Computer IP is 192.168.10.10/255.255.255.0 -> broadcast IP: 192.168.10.255
But when i try this below code:

InetAddress localHost = Inet4Address.getLocalHost();
NetworkInterface networkInterface = NetworkInterface.getByInetAddress(localHost);

int iNICSize = networkInterface.getInterfaceAddresses().size();
for (int j = 0; j < iNICSize; j++) {
 InterfaceAddress ifa = networkInterface.getInterfaceAddresses().get(j);
 if (ifa.getAddress() instanceof Inet6Address) {
  logger.info("Skipped IPv6 address (not supported) " + ifa.getAddress());
  continue;
 }
       
 broadcastIP = ifa.getBroadcast();
 logger.info("Found broadcast: " + broadcastIP);
 break;
}

It works well in JDK 7, but JDK 6 (Open remote uses) give an incorrect broadcast IP.
JDK 6 give 0.0.0.0 for this ip. Please help to find other ways.

The OpenRemote Pro as of version 1.0.13 does work with Java 7. Don't know when this will trickle into the free version.

Posted by pz1 at Jun 04, 2014 09:58

Can I use Java7 with Openremote free version, what errors will occurs?

Posted by or-sbus at Jun 05, 2014 06:01

OP works with JDK7. Just the rule engine from the current download version does not work with JDK7.
If you don't want to use rules for now, you can take JDK7.
There is a patch on the forums which enables drools for JDK7 if you need rules.

Posted by mredeker at Jun 05, 2014 09:26

Thanks,
currently, i don't use rules.

Posted by or-sbus at Jun 05, 2014 09:56
Document generated by Confluence on Jun 05, 2016 09:36