com.sleepycat.je.rep.utilint
Class FreePortLocator

java.lang.Object
  extended by com.sleepycat.je.rep.utilint.FreePortLocator

public class FreePortLocator
extends Object

An iterator to iterate over the free ports on an interface.


Constructor Summary
FreePortLocator(String hostname, int portStart, int portEnd)
          Constructor identifying the interface and the port range within which to look for free ports.
 
Method Summary
 int next()
          Returns the next free port.
 void skip(int num)
          Skip a number of ports.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FreePortLocator

public FreePortLocator(String hostname,
                       int portStart,
                       int portEnd)
Constructor identifying the interface and the port range within which to look for free ports.

Method Detail

next

public int next()
Returns the next free port. Note that it's possible that on a busy machine another process may grab the "free" port before it's actually used.


skip

public void skip(int num)
Skip a number of ports.



Copyright (c) 2004-2012 Oracle. All rights reserved.