My application is deployed in websphere server and from java code, I need to get listening port of the server.
NOTE: I am using below line for getting internal host name of the system. InetAddress.getLocalHost().getHostName();
EDIT: Our server is running on local port 30036 and a local host name. We cannot connect this server using these host and port from out side. We have separate public host/port for outside connection. But in our scenario, we want to access a service running on the same server from the java code. Any way to get this internal port dynamically?