java - Ubuntu - UnknownHostException when connecting to a PC, using a Socket in an Ad Hoc network -
i have created filesystemlistener listens files in folder , sends them specified ip address. has been tested standard wireless network getting unkownhostexception when running on ad hoc network.
i not sure if should ask on superuser, or here, not sure if issue code or ubuntu.
i can ping other pc on wireless network keep getting above exception when connecting through java.
not sure if helps here basic ssce can think of:
import java.net.socket; public class clienttester { public static void main(string[] args) { socket s = new socket("192.168.0.1", 4440); } } anyone come across before, wanted see if java issue before cross posted in superuser.
thanks!
to compile correctly, unknownhostexception "must caught or declared thrown."
for example:
import java.io.ioexception; import java.net.socket; import java.net.unknownhostexception; public class clienttester { public static void main(string[] args) throws unknownhostexception, ioexception { socket s = new socket("192.168.0.1", 4440); } }
Comments
Post a Comment