Class ConnectionManagerImpl
- java.lang.Object
-
- com.biglybt.pifimpl.local.network.ConnectionManagerImpl
-
- All Implemented Interfaces:
ConnectionManager
public class ConnectionManagerImpl extends java.lang.Object implements ConnectionManager
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ConnectionManagerImpl.PluginRateLimiter
-
Field Summary
Fields Modifier and Type Field Description private Core
core
private static ConnectionManagerImpl
instance
-
Fields inherited from interface com.biglybt.pif.network.ConnectionManager
NAT_BAD, NAT_OK, NAT_PROBABLY_OK, NAT_UNKNOWN
-
-
Constructor Summary
Constructors Modifier Constructor Description private
ConnectionManagerImpl(Core _core)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Connection
createConnection(java.net.InetSocketAddress remote_address, MessageStreamEncoder encoder, MessageStreamDecoder decoder)
Create a new unconnected remote connection (for outbound-initiated connections).RateLimiter
createRateLimiter(java.lang.String name, int bps)
TransportCipher
createTransportCipher(java.lang.String algorithm, int mode, javax.crypto.spec.SecretKeySpec key_spec, java.security.spec.AlgorithmParameterSpec params)
TransportFilter
createTransportFilter(Connection connection, TransportCipher read_cipher, TransportCipher write_cipher)
int
getNATStatus()
Returns the current view on whether or not we are inwardly connectable via our listener portjava.lang.Object[]
getNATStatusEx()
static ConnectionManagerImpl
getSingleton(Core core)
-
-
-
Field Detail
-
instance
private static ConnectionManagerImpl instance
-
core
private Core core
-
-
Constructor Detail
-
ConnectionManagerImpl
private ConnectionManagerImpl(Core _core)
-
-
Method Detail
-
getSingleton
public static ConnectionManagerImpl getSingleton(Core core)
-
createConnection
public Connection createConnection(java.net.InetSocketAddress remote_address, MessageStreamEncoder encoder, MessageStreamDecoder decoder)
Description copied from interface:ConnectionManager
Create a new unconnected remote connection (for outbound-initiated connections).- Specified by:
createConnection
in interfaceConnectionManager
- Parameters:
remote_address
- to connect to- Returns:
- not yet established connection
-
getNATStatus
public int getNATStatus()
Description copied from interface:ConnectionManager
Returns the current view on whether or not we are inwardly connectable via our listener port- Specified by:
getNATStatus
in interfaceConnectionManager
- Returns:
-
getNATStatusEx
public java.lang.Object[] getNATStatusEx()
- Specified by:
getNATStatusEx
in interfaceConnectionManager
-
createTransportCipher
public TransportCipher createTransportCipher(java.lang.String algorithm, int mode, javax.crypto.spec.SecretKeySpec key_spec, java.security.spec.AlgorithmParameterSpec params) throws TransportException
- Specified by:
createTransportCipher
in interfaceConnectionManager
- Throws:
TransportException
-
createTransportFilter
public TransportFilter createTransportFilter(Connection connection, TransportCipher read_cipher, TransportCipher write_cipher) throws TransportException
- Specified by:
createTransportFilter
in interfaceConnectionManager
- Throws:
TransportException
-
createRateLimiter
public RateLimiter createRateLimiter(java.lang.String name, int bps)
- Specified by:
createRateLimiter
in interfaceConnectionManager
-
-