Class UDPConnectionManager
- java.lang.Object
-
- com.biglybt.core.networkmanager.impl.udp.UDPConnectionManager
-
- All Implemented Interfaces:
NetworkGlueListener
public class UDPConnectionManager extends java.lang.Object implements NetworkGlueListener
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
UDPConnectionManager.ProtocolTimer
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protected
UDPConnectionManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
accept(int local_port, java.net.InetSocketAddress remote_address, UDPConnection connection)
protected int
allocationConnectionID()
protected UDPSelector
checkThreadCreation()
protected void
checkThreadDeath(boolean connections_running)
void
connectOutbound(UDPTransport udp_transport, java.net.InetSocketAddress address, byte[][] shared_secrets, java.nio.ByteBuffer initial_data, Transport.ConnectListener listener)
void
failed(UDPConnectionSet set)
int
getMaxOutboundPermitted()
protected void
logStats()
protected void
poll()
protected boolean
rateLimitIncoming(java.net.InetSocketAddress s_address)
void
receive(int local_port, java.net.InetSocketAddress remote_address, byte[] data, int data_length)
protected UDPConnection
registerOutgoing(UDPTransportHelper helper)
void
remove(UDPConnectionSet set, UDPConnection connection)
int
send(int local_port, java.net.InetSocketAddress remote_address, byte[] data)
protected void
timeoutDeadKeys()
protected boolean
trace()
protected void
trace(java.lang.String str)
-
-
-
Field Detail
-
LOGID
static final LogIDs LOGID
-
LOOPBACK
private static final boolean LOOPBACK
- See Also:
- Constant Field Values
-
FORCE_LOG
private static final boolean FORCE_LOG
- See Also:
- Constant Field Values
-
LOG
static boolean LOG
-
max_outbound_connections
static int max_outbound_connections
-
TIMER_TICK_MILLIS
public static final int TIMER_TICK_MILLIS
- See Also:
- Constant Field Values
-
THREAD_LINGER_ON_IDLE_PERIOD
public static final int THREAD_LINGER_ON_IDLE_PERIOD
- See Also:
- Constant Field Values
-
DEAD_KEY_RETENTION_PERIOD
public static final int DEAD_KEY_RETENTION_PERIOD
- See Also:
- Constant Field Values
-
STATS_TIME
public static final int STATS_TIME
- See Also:
- Constant Field Values
-
STATS_TICKS
public static final int STATS_TICKS
- See Also:
- Constant Field Values
-
connection_sets
final java.util.Map connection_sets
-
recently_dead_keys
final java.util.Map recently_dead_keys
-
next_connection_id
private int next_connection_id
-
incoming_manager
final IncomingConnectionManager incoming_manager
-
network_glue
private final NetworkGlue network_glue
-
selector
private UDPSelector selector
-
protocol_timer
private UDPConnectionManager.ProtocolTimer protocol_timer
-
idle_start
private long idle_start
-
BLOOM_RECREATE
private static final int BLOOM_RECREATE
- See Also:
- Constant Field Values
-
BLOOM_INCREASE
private static final int BLOOM_INCREASE
- See Also:
- Constant Field Values
-
incoming_bloom
private BloomFilter incoming_bloom
-
incoming_bloom_create_time
private long incoming_bloom_create_time
-
last_incoming
private long last_incoming
-
rate_limit_discard_packets
private int rate_limit_discard_packets
-
rate_limit_discard_bytes
private int rate_limit_discard_bytes
-
setup_discard_packets
private int setup_discard_packets
-
setup_discard_bytes
private int setup_discard_bytes
-
outbound_connection_count
volatile int outbound_connection_count
-
max_conn_exceeded_logged
private boolean max_conn_exceeded_logged
-
-
Method Detail
-
connectOutbound
public void connectOutbound(UDPTransport udp_transport, java.net.InetSocketAddress address, byte[][] shared_secrets, java.nio.ByteBuffer initial_data, Transport.ConnectListener listener)
-
getMaxOutboundPermitted
public int getMaxOutboundPermitted()
-
checkThreadCreation
protected UDPSelector checkThreadCreation()
-
checkThreadDeath
protected void checkThreadDeath(boolean connections_running)
-
poll
protected void poll()
-
remove
public void remove(UDPConnectionSet set, UDPConnection connection)
-
failed
public void failed(UDPConnectionSet set)
-
registerOutgoing
protected UDPConnection registerOutgoing(UDPTransportHelper helper) throws java.io.IOException
- Throws:
java.io.IOException
-
receive
public void receive(int local_port, java.net.InetSocketAddress remote_address, byte[] data, int data_length)
- Specified by:
receive
in interfaceNetworkGlueListener
-
rateLimitIncoming
protected boolean rateLimitIncoming(java.net.InetSocketAddress s_address)
-
send
public int send(int local_port, java.net.InetSocketAddress remote_address, byte[] data) throws java.io.IOException
- Throws:
java.io.IOException
-
accept
protected void accept(int local_port, java.net.InetSocketAddress remote_address, UDPConnection connection)
-
allocationConnectionID
protected int allocationConnectionID()
-
timeoutDeadKeys
protected void timeoutDeadKeys()
-
logStats
protected void logStats()
-
trace
protected boolean trace()
-
trace
protected void trace(java.lang.String str)
-
-