Class GenericMessageConnectionIndirect
java.lang.Object
com.biglybt.pifimpl.local.messaging.GenericMessageConnectionIndirect
- All Implemented Interfaces:
GenericMessageConnectionAdapter
public class GenericMessageConnectionIndirect
extends Object
implements GenericMessageConnectionAdapter
-
Nested Class Summary
Nested classes/interfaces inherited from interface GenericMessageConnectionAdapter
GenericMessageConnectionAdapter.ConnectionListener -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate longprivate static longprivate GenericMessageEndpointprivate booleanprivate static final intprivate static final intprivate booleanprivate static final intprivate static ThreadPoolprivate longprivate longprivate static Mapprivate static final LogIDsstatic final intprivate static final intprivate static final intprivate MessageManagerImplprivate static final intprivate static final intprivate static final intprivate static final intprivate Stringprivate Stringprivate NATTraverserprivate GenericMessageConnectionImplprivate static Mapprivate InetSocketAddressprivate LinkedList<byte[]> private AESemaphoreprivate static final intprivate static final intprivate InetSocketAddressprivate static final intprivate static final boolean -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedGenericMessageConnectionIndirect(MessageManagerImpl _message_manager, String _msg_id, String _msg_desc, GenericMessageEndpoint _endpoint, long _connection_id) protectedGenericMessageConnectionIndirect(MessageManagerImpl _message_manager, String _msg_id, String _msg_desc, GenericMessageEndpoint _endpoint, InetSocketAddress _rendezvous, InetSocketAddress _target) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccepted()voidaddInboundRateLimiter(RateLimiter limiter) voidaddOutboundRateLimiter(RateLimiter limiter) voidclose()protected voidvoidconnect(ByteBuffer initial_data, GenericMessageConnectionAdapter.ConnectionListener listener) protected static StringgetConnectionStatus(Map connections) longprotected static Stringintprotected static StringintgetType()protected booleanisClosed()protected voidprotected static voidprotected booleanprepareForKeepAlive(boolean force) protected static Mapreceive(MessageManagerImpl message_manager, InetSocketAddress originator, Map message) protected List<byte[]> protected booleanvoidremoveInboundRateLimiter(RateLimiter limiter) voidremoveOutboundRateLimiter(RateLimiter limiter) voidsend(PooledByteBuffer pbb) protected voidvoidsetOwner(GenericMessageConnectionImpl _owner) protected void
-
Field Details
-
LOGID
-
TRACE
private static final boolean TRACE- See Also:
-
MAX_MESSAGE_SIZE
public static final int MAX_MESSAGE_SIZE- See Also:
-
MESSAGE_TYPE_CONNECT
private static final int MESSAGE_TYPE_CONNECT- See Also:
-
MESSAGE_TYPE_ERROR
private static final int MESSAGE_TYPE_ERROR- See Also:
-
MESSAGE_TYPE_DATA
private static final int MESSAGE_TYPE_DATA- See Also:
-
MESSAGE_TYPE_DISCONNECT
private static final int MESSAGE_TYPE_DISCONNECT- See Also:
-
TICK_PERIOD
private static final int TICK_PERIOD- See Also:
-
KEEP_ALIVE_CHECK_PERIOD
private static final int KEEP_ALIVE_CHECK_PERIOD- See Also:
-
KEEP_ALIVE_MIN
private static final int KEEP_ALIVE_MIN- See Also:
-
STATS_PERIOD
private static final int STATS_PERIOD- See Also:
-
KEEP_ALIVE_CHECK_TICKS
private static final int KEEP_ALIVE_CHECK_TICKS- See Also:
-
STATS_TICKS
private static final int STATS_TICKS- See Also:
-
MAX_REMOTE_CONNECTIONS
private static final int MAX_REMOTE_CONNECTIONS- See Also:
-
MAX_REMOTE_CONNECTIONS_PER_IP
private static final int MAX_REMOTE_CONNECTIONS_PER_IP- See Also:
-
connection_id_next
private static long connection_id_next -
local_connections
-
remote_connections
-
keep_alive_pool
-
message_manager
-
msg_id
-
msg_desc
-
endpoint
-
nat_traverser
-
owner
-
rendezvous
-
target
-
connection_id
private long connection_id -
incoming
private boolean incoming -
closed
private boolean closed -
send_queue
-
send_queue_sem
-
last_message_sent
private volatile long last_message_sent -
last_message_received
private volatile long last_message_received -
keep_alive_in_progress
private volatile boolean keep_alive_in_progress
-
-
Constructor Details
-
GenericMessageConnectionIndirect
protected GenericMessageConnectionIndirect(MessageManagerImpl _message_manager, String _msg_id, String _msg_desc, GenericMessageEndpoint _endpoint, InetSocketAddress _rendezvous, InetSocketAddress _target) -
GenericMessageConnectionIndirect
protected GenericMessageConnectionIndirect(MessageManagerImpl _message_manager, String _msg_id, String _msg_desc, GenericMessageEndpoint _endpoint, long _connection_id)
-
-
Method Details
-
receive
protected static Map receive(MessageManagerImpl message_manager, InetSocketAddress originator, Map message) -
getRemoteConnectionStatus
-
getLocalConnectionStatus
-
getConnectionStatus
-
setOwner
- Specified by:
setOwnerin interfaceGenericMessageConnectionAdapter
-
getMaximumMessageSize
public int getMaximumMessageSize()- Specified by:
getMaximumMessageSizein interfaceGenericMessageConnectionAdapter
-
getType
- Specified by:
getTypein interfaceGenericMessageConnectionAdapter
-
getTransportType
public int getTransportType()- Specified by:
getTransportTypein interfaceGenericMessageConnectionAdapter
-
getLastMessageReceivedTime
public long getLastMessageReceivedTime() -
getEndpoint
- Specified by:
getEndpointin interfaceGenericMessageConnectionAdapter
-
getStartpoint
- Specified by:
getStartpointin interfaceGenericMessageConnectionAdapter
-
getConnection
- Specified by:
getConnectionin interfaceGenericMessageConnectionAdapter
-
addInboundRateLimiter
- Specified by:
addInboundRateLimiterin interfaceGenericMessageConnectionAdapter
-
removeInboundRateLimiter
- Specified by:
removeInboundRateLimiterin interfaceGenericMessageConnectionAdapter
-
addOutboundRateLimiter
- Specified by:
addOutboundRateLimiterin interfaceGenericMessageConnectionAdapter
-
removeOutboundRateLimiter
- Specified by:
removeOutboundRateLimiterin interfaceGenericMessageConnectionAdapter
-
connect
public void connect(ByteBuffer initial_data, GenericMessageConnectionAdapter.ConnectionListener listener) - Specified by:
connectin interfaceGenericMessageConnectionAdapter
-
accepted
public void accepted()- Specified by:
acceptedin interfaceGenericMessageConnectionAdapter
-
send
- Specified by:
sendin interfaceGenericMessageConnectionAdapter- Throws:
MessageException
-
send
-
receive
-
receiveIncomplete
protected boolean receiveIncomplete() -
close
- Specified by:
closein interfaceGenericMessageConnectionAdapter- Throws:
MessageException
-
close
- Throws:
MessageException
-
isClosed
protected boolean isClosed() -
prepareForKeepAlive
protected boolean prepareForKeepAlive(boolean force) -
keepAlive
protected void keepAlive() -
log
-
trace
-