rice.pastry.socket
Class SocketNATHandler
java.lang.Object
rice.pastry.socket.StubNATHandler
rice.pastry.socket.SocketNATHandler
-
All Implemented Interfaces:
- NATHandler
-
public class SocketNATHandler
- extends StubNATHandler
- implements NATHandler
Constructor Summary |
SocketNATHandler(Environment env,
java.net.InetSocketAddress localAddress,
java.net.InetSocketAddress proxyAddress)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ALWAYS
public static final int ALWAYS
- See Also:
- Constant Field Values
PREFIX_MATCH
public static final int PREFIX_MATCH
- See Also:
- Constant Field Values
NEVER
public static final int NEVER
- See Also:
- Constant Field Values
OVERWRITE
public static final int OVERWRITE
- See Also:
- Constant Field Values
USE_DIFFERENT_PORT
public static final int USE_DIFFERENT_PORT
- See Also:
- Constant Field Values
FAIL
public static final int FAIL
- See Also:
- Constant Field Values
MAX_PORT
public static final int MAX_PORT
- See Also:
- Constant Field Values
SocketNATHandler
public SocketNATHandler(Environment env,
java.net.InetSocketAddress localAddress,
java.net.InetSocketAddress proxyAddress)
findFireWall
public java.net.InetAddress findFireWall(java.net.InetAddress bindAddress)
throws java.io.IOException
-
-
-
Throws:
java.io.IOException
findAvailableFireWallPort
public int findAvailableFireWallPort(int internal,
int external)
throws java.io.IOException
-
-
-
Throws:
java.io.IOException
openFireWallPort
public void openFireWallPort(int local,
int external)
throws java.io.IOException
-
-
-
Throws:
java.io.IOException
getFireWallPolicyVariable
protected int getFireWallPolicyVariable(java.lang.String key)
-
- Overrides:
-
getFireWallPolicyVariable
in class StubNATHandler
-
localAddressIsProbablyNatted
public boolean localAddressIsProbablyNatted()
-
- Overrides:
-
localAddressIsProbablyNatted
in class StubNATHandler
-
- Returns:
- true if ip address matches firewall prefix
findFireWallIfNecessary
public boolean findFireWallIfNecessary()
throws java.io.IOException
-
-
-
Throws:
java.io.IOException
usingNAT
public boolean usingNAT()
-
- Specified by:
-
usingNAT
in interface NATHandler
- Overrides:
-
usingNAT
in class StubNATHandler
-
externalAddress
public java.net.InetSocketAddress externalAddress()
throws java.io.IOException
-
- Specified by:
-
externalAddress
in interface NATHandler
- Overrides:
-
externalAddress
in class StubNATHandler
-
-
Throws:
java.io.IOException
test
public boolean test()
-
- Specified by:
-
test
in interface NATHandler
- Overrides:
-
test
in class StubNATHandler
-
Copyright © 2001-2005 - Rice Pastry.