|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnl.openfortress.socket6bed4.ConnectionPool
public class ConnectionPool
The ConnectionPool links IPv4 sockets for 6bed4 with the implementations of IPv6 sockets. Each IPv4 socket may have multiple IPv6 sockets, as a result of these variation factors: - the router supplies a range of IPv6 addresses - the IPv6 DatagramSockets can listen to multiple ports - the IPv6 DatagramSockets could receive from multiple ports Incoming traffic is mapped based on an InetSocketAddress; if an exact match is not available, then the zero address is tried instead. The sender information is stored in a Datagrampacket's SocketAddress.
Field Summary | |
---|---|
protected Hashtable<Inet6Address,InetSocketAddress> |
addressmap
|
protected Hashtable<InetSocketAddress,DatagramSocket6bed4> |
clients
|
protected InetSocketAddress |
default_server
|
protected static byte[] |
serveripbytes
|
protected static int |
serverport
|
protected Hashtable<InetSocketAddress,ServerNode> |
servers
|
Constructor Summary | |
---|---|
ConnectionPool()
Construct a ServerPool with nothing but the default server. |
Method Summary | |
---|---|
void |
closeServer(InetSocketAddress isa)
Stop using a server, possibly removing it. |
InetSocketAddress |
getDefaultServer()
Return the default 6bed4 tunnel server. |
ServerNode |
getDefaultServerNode()
Return the ServerNode for the default 6bed4 tunnel server. |
ServerNode |
getServerNode(InetAddress ia)
Returns the ServerNode for a given InetAddress, which is then assumed to match an Inet6Address in the hash tables. |
ServerNode |
getServerNode(InetSocketAddress isa)
Return the ServerNode for a given InetSocketAddress, holding the server's IPv4 address and UDP port. |
static ConnectionPool |
getSharedConnectionPool()
Return the connection pool intended to be shared. |
ServerNode |
openServer(InetSocketAddress isa)
Start using a server, possibly introducing it. |
void |
setDefaultServer(InetSocketAddress isa)
Change the server that counts as the default tunnel server for future connection attempts. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final byte[] serveripbytes
protected static final int serverport
protected InetSocketAddress default_server
protected Hashtable<InetSocketAddress,DatagramSocket6bed4> clients
protected Hashtable<InetSocketAddress,ServerNode> servers
protected Hashtable<Inet6Address,InetSocketAddress> addressmap
Constructor Detail |
---|
public ConnectionPool() throws SocketException
SocketException
Method Detail |
---|
public static ConnectionPool getSharedConnectionPool()
public ServerNode openServer(InetSocketAddress isa) throws UnknownHostException, SocketException
UnknownHostException
SocketException
public void closeServer(InetSocketAddress isa) throws UnknownHostException
UnknownHostException
public InetSocketAddress getDefaultServer()
public ServerNode getDefaultServerNode()
public ServerNode getServerNode(InetSocketAddress isa)
public ServerNode getServerNode(InetAddress ia)
public void setDefaultServer(InetSocketAddress isa) throws UnknownHostException, SocketException
UnknownHostException
SocketException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |