Search code examples
javaclientiprmi

How can I get the Client IP of the java RMI programming?


Can anyone explain how I can get the client IP of the Java RMI programming, including a sample of how to use it?

I have looked up the Java API, but it is hard to understand.

I would like to print the client IP on server


Solution

  • The only method in the RemoteServer class that you ever need to call is getClientHost(). That's the one that does what you asked about in your title.