org.sapia.ubik.net
Class TcpPortSelector

java.lang.Object
  extended by org.sapia.ubik.net.TcpPortSelector

public class TcpPortSelector
extends java.lang.Object

An instance of this class is used to perform random port selection on a given host.

Author:
yduchesne

Constructor Summary
TcpPortSelector()
           
 
Method Summary
 int select(java.net.InetAddress addr)
           
 int select(java.lang.String host)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TcpPortSelector

public TcpPortSelector()
Method Detail

select

public int select(java.net.InetAddress addr)
           throws java.io.IOException
Parameters:
addr - the InetAddress corresponding to the local address on which to acquire a port.
Returns:
the port that was selected.
Throws:
java.io.IOException - if a problem occurred while acquiring the port.

select

public int select(java.lang.String host)
           throws java.io.IOException
Parameters:
host - the local host address on which to acquire a port.
Returns:
the port that was selected.
Throws:
java.io.IOException - if a problem occurred while acquiring the port.


Copyright © 2010 Sapia OSS. All Rights Reserved.