org.codeartisans.java.toolbox.network
Class FreePortFinder

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

public final class FreePortFinder
extends java.lang.Object


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

Field Detail

LOOPBACK

public static final java.lang.String LOOPBACK
See Also:
Constant Field Values

ALL_INTERFACES

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

isFree

public static boolean isFree(int port)

isFree

public static boolean isFree(java.net.InetAddress address,
                             int port)

findRandom

public static int findRandom()
                      throws java.io.IOException
Throws:
java.io.IOException

findWithPreference

public static int findWithPreference(int prefered)
                              throws java.io.IOException
Throws:
java.io.IOException

findRandomOnIface

public static int findRandomOnIface(java.net.InetAddress address)
                             throws java.io.IOException
Throws:
java.io.IOException

findOnIfaceWithPreference

public static int findOnIfaceWithPreference(java.net.InetAddress address,
                                            int prefered)
                                     throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2012. All Rights Reserved.