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
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.