I've written a thread using java.net.SocketServer
to listen on a particular port. It works fine in the android simulator (using port forwarding). I'm planning to connect over wifi to this port when the app is being used. However, the SocketServer
documentation says that if you don't supply an InetAddress
, the server listens on localhost.
Am I correct that if I do not supply the address, I will not be able to get a connection over wifi? How can I get the InetAddress
of the wifi connection to pass to the SocketServer
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…