Eclipse JDT
2.0

org.eclipse.jdt.launching
Class SocketUtil

java.lang.Object
  |
  +--org.eclipse.jdt.launching.SocketUtil

public class SocketUtil
extends Object

Utility class to find a port to debug on.


Constructor Summary
SocketUtil()
           
 
Method Summary
static int findUnusedLocalPort(String host, int searchFrom, int searchTo)
          Returns a free port number on the specified host within the given range, or -1 if none found.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketUtil

public SocketUtil()
Method Detail

findUnusedLocalPort

public static int findUnusedLocalPort(String host,
                                      int searchFrom,
                                      int searchTo)
Returns a free port number on the specified host within the given range, or -1 if none found.

Parameters:
host - name or IP addres of host on which to find a free port
searchFrom - the port number from which to start searching
searchTo - the port number at which to stop searching
Returns:
a free port in the specified range, or -1 of none found

Eclipse JDT
2.0

Copyright (c) IBM Corp. and others 2000, 2002. All Rights Reserved.