|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.unkrig.commons.net.ftp.DataConnectionProxy
public class DataConnectionProxy
A proxy for the FTP data connection.
| Constructor Summary | |
|---|---|
DataConnectionProxy()
|
|
| Method Summary | |
|---|---|
static void |
setLocalPortRange(int first,
int last)
Defines the port that will be used for the server socket for all data connection proxies. |
java.net.InetSocketAddress |
start(java.net.InetAddress bindAddress,
java.net.InetSocketAddress remoteAddress)
Finds a free port on the given local interface and creates a server socket. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DataConnectionProxy()
| Method Detail |
|---|
public static void setLocalPortRange(int first,
int last)
If first and last are zero (which is the default), then an "ephemeral port" is picked for each
data connection proxy (see InetSocketAddress.InetSocketAddress(int)).
Otherwise, if first and last are equal, then exactly that port is used for the server socket
of each data connection proxy (this limits the number of data connections to one at any given time).
Otherwise, first is used for the server socket of the first data connection proxy, then first + 1 (or first - 1, if last < first), and so on up to and including last,
then first again, and so on. If the port is already in use, then the next port is tried, until a
"free" port is found, and a BindException is only thrown if all ports are already in use.
Must not be invoked after the first call to start(InetAddress, InetSocketAddress).
public java.net.InetSocketAddress start(java.net.InetAddress bindAddress,
java.net.InetSocketAddress remoteAddress)
throws java.io.IOException
bindAddress - The local interface to bind this server toremoteAddress - The remote address and port to connect to
java.io.IOExceptionsetLocalPortRange(int, int)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||