networking - How can a java application running on windows 7 choose which network adapter to use -
hi writing application device -- tablet -- running windows 7. application being written in java. application needs aware of networking adapter available (wifi, 3g, etc ...) there java library similar 1 developed android -- android.net, android.net.wifi, etc ... -- in brief, how can java application running on windows 7 choose network adapter use ? thank you!
you can see network interfaces available using java.net.networkinterface.getnetworkinterfaces()
. note: loopback interface present in list.
however, appears way force system use particular network interfaces referring ip address particular network interface on. example, 4-arg socket
constructors take local address third argument (i linked one, other takes hostname first argument).
datagramsocket
has 2-arg constructor similar.
Comments
Post a Comment