Results 1 to 2 of 2
  1. #1
    sandeepspatil is offline Member
    Join Date
    Jul 2007
    Posts
    5
    Rep Power
    0

    Default How to know the ports opened by JVM

    Hi,

    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?

    Thanks,
    Sandeep

  2. #2
    brianhks is offline Senior Member
    Join Date
    Jul 2007
    Posts
    135
    Rep Power
    0

    Default

    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.

Similar Threads

  1. Deleting a File that is opened
    By ravian in forum Advanced Java
    Replies: 6
    Last Post: 01-30-2008, 02:05 PM
  2. Reading an already opened file
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-25-2008, 06:50 PM
  3. Looking for servers on ports
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-13-2007, 09:28 AM
  4. Replies: 0
    Last Post: 12-04-2007, 11:11 AM
  5. Ports In Java
    By Peter in forum Advanced Java
    Replies: 2
    Last Post: 07-02-2007, 06:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •