You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:
have access to post topics
communicate privately with other members (PM)
not see advertisements between posts
have the possibility to earn one of our surprises if you are an active member
access many other special features that will be introduced later.
Is there some way to know all the ports that have been opened by the current instance of JVM?
Or say the list of all the serverSockets that have been created by the current instance of JVM?
depends on the platform. You can use netstat. Maybe you mean to do it programatically. I don't know of a way to do that.
One option is to set a socket factory on the ServerSocket class. Then it will call your factory every time a socket is asked for. This way you can keep track of what sockets are out.