Is there a way to find a port being used by process, given its process id , using java?
问题 Is there a way to find a port opened by java process, given the process id of the process in java? Need to find it using java as it has to be platform independent Given a process id : output any port/socket connections being used by that process. Few things given: Process running in same jvm. There is only 1 port/socket being used by that Process, for which the Pid is given. Can not do platform specific commands like ps -au | grep pid | ... 回答1: The answer is no. What processes have what