Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

NetworkInterface.getByInetAddress() in a remote computer  RSS feed

 
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the code I have. Obviously it doesn't work because the given ip is a remote computer.

My question is:is it possible to use some sort of this code (something similar) to get the NetworkInterface of a remote machine?




thanks in advance,
 
Ranch Hand
Posts: 490
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming you have a connection via Socket, you can look at the socket class, you will see a method called getRemoteSocketAddress that returns a SocketAddress which will print the IP address and port of the other endpoint. That is probably the most direct way.
 
It is an experimental device that will make my mind that most powerful force on earth! More powerful than this tiny ad!
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!