Skip to content
Advertisement

SLP Java function causing SocketException due to IP_MULTICAST_IF

I’m attempting to use Java to find a SLP service named test, that is running on my network and create a connection to it. I know the service is running and can use the command “slptool findsrvs service:test” to find it. This command returns “service:test://192.168.1.4:12345,65535”. However the following code:

JavaScript

produces the following output:

JavaScript

I’m assuming the null is printed for the print sle.nextElement() statement due to the failure of the locator look up in line 7:

JavaScript

So my question is does anyone know why a bad argument for IP_MULTICAST_IF could cause this and how to fix it? And if someone sees something that could be causing a problem other than the IP_MULTICAST_IF please feel free to point it out.

On a side note if it helps to know I am using JavaSE-1.6, jslp-0.7.1, and commons-loggin-1.1.1 libraries on Ubuntu 11.04.

Advertisement

Answer

I just ran into the same issue. What fixed it for me was doing a

JavaScript

at startup, which can also be done by adding the following argument to the java cmd line instead.

JavaScript
Advertisement