org.codeartisans.java.toolbox.network
Class FreePortFinder

java.lang.Object
  extended by org.codeartisans.java.toolbox.network.FreePortFinder

public final class FreePortFinder
extends Object


Field Summary
static String ALL_INTERFACES
           
static String LOOPBACK
           
 
Method Summary
static int findOnIfaceWithPreference(InetAddress address, int prefered)
           
static int findRandom()
           
static int findRandomOnIface(InetAddress address)
           
static int findWithPreference(int prefered)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOOPBACK

public static final String LOOPBACK
See Also:
Constant Field Values

ALL_INTERFACES

public static final String ALL_INTERFACES
See Also:
Constant Field Values
Method Detail

findRandom

public static int findRandom()
                      throws IOException
Throws:
IOException

findWithPreference

public static int findWithPreference(int prefered)
                              throws IOException
Throws:
IOException

findRandomOnIface

public static int findRandomOnIface(InetAddress address)
                             throws IOException
Throws:
IOException

findOnIfaceWithPreference

public static int findOnIfaceWithPreference(InetAddress address,
                                            int prefered)
                                     throws IOException
Throws:
IOException


Copyright © 2010. All Rights Reserved.