Class IncomingConnectionManager
- java.lang.Object
-
- com.biglybt.core.networkmanager.impl.IncomingConnectionManager
-
public class IncomingConnectionManager extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
IncomingConnectionManager.IncomingConnection
static interface
IncomingConnectionManager.MatchListener
Listener for byte matches.protected class
IncomingConnectionManager.SelectorListener
-
Field Summary
Fields Modifier and Type Field Description private java.util.ArrayList
connections
private AEMonitor
connections_mon
(package private) static LogIDs
LOGID
private java.util.Map
match_buffers_cow
private AEMonitor
match_buffers_mon
private int
max_match_buffer_size
private int
max_min_match_buffer_size
private static IncomingConnectionManager
singleton
-
Constructor Summary
Constructors Modifier Constructor Description protected
IncomingConnectionManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addConnection(int local_port, TransportHelperFilter filter, Transport new_transport)
void
addSharedSecrets(byte[][] secrets)
java.lang.Object[]
checkForMatch(TransportHelper transport, int incoming_port, java.nio.ByteBuffer to_check, boolean min_match)
void
deregisterMatchBytes(NetworkManager.ByteMatcher to_remove)
Remove the given byte sequence match from the registration list.protected void
doTimeoutChecks()
int
getMaxMatchBufferSize()
int
getMaxMinMatchBufferSize()
static IncomingConnectionManager
getSingleton()
boolean
isEmpty()
void
registerMatchBytes(NetworkManager.ByteMatcher matcher, IncomingConnectionManager.MatchListener listener)
Register the given byte sequence matcher to handle matching against new incoming connection initial data; i.e.protected void
removeConnection(IncomingConnectionManager.IncomingConnection connection, boolean close_as_well, java.lang.String reason)
void
removeSharedSecrets(byte[][] secrets)
-
-
-
Field Detail
-
LOGID
static final LogIDs LOGID
-
singleton
private static final IncomingConnectionManager singleton
-
match_buffers_cow
private volatile java.util.Map match_buffers_cow
-
match_buffers_mon
private final AEMonitor match_buffers_mon
-
max_match_buffer_size
private int max_match_buffer_size
-
max_min_match_buffer_size
private int max_min_match_buffer_size
-
connections
private final java.util.ArrayList connections
-
connections_mon
private final AEMonitor connections_mon
-
-
Method Detail
-
getSingleton
public static IncomingConnectionManager getSingleton()
-
isEmpty
public boolean isEmpty()
-
checkForMatch
public java.lang.Object[] checkForMatch(TransportHelper transport, int incoming_port, java.nio.ByteBuffer to_check, boolean min_match)
-
registerMatchBytes
public void registerMatchBytes(NetworkManager.ByteMatcher matcher, IncomingConnectionManager.MatchListener listener)
Register the given byte sequence matcher to handle matching against new incoming connection initial data; i.e. the first bytes read from a connection must match in order for the given listener to be invoked.- Parameters:
matcher
- byte filter sequencelistener
- to call upon match
-
deregisterMatchBytes
public void deregisterMatchBytes(NetworkManager.ByteMatcher to_remove)
Remove the given byte sequence match from the registration list.- Parameters:
to_remove
- byte sequence originally used to register
-
addSharedSecrets
public void addSharedSecrets(byte[][] secrets)
-
removeSharedSecrets
public void removeSharedSecrets(byte[][] secrets)
-
getMaxMatchBufferSize
public int getMaxMatchBufferSize()
-
getMaxMinMatchBufferSize
public int getMaxMinMatchBufferSize()
-
addConnection
public void addConnection(int local_port, TransportHelperFilter filter, Transport new_transport)
-
removeConnection
protected void removeConnection(IncomingConnectionManager.IncomingConnection connection, boolean close_as_well, java.lang.String reason)
-
doTimeoutChecks
protected void doTimeoutChecks()
-
-