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 com.biglybt.pifimpl.local.messaging.GenericMessageConnectionAdapter
GenericMessageConnectionAdapter.ConnectionListener
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private long
private static long
private GenericMessageEndpoint
private boolean
private static final int
private static final int
private boolean
private static final int
private static ThreadPool
private long
private long
private static Map
private static final LogIDs
static final int
private static final int
private static final int
private MessageManagerImpl
private static final int
private static final int
private static final int
private static final int
private String
private String
private NATTraverser
private GenericMessageConnectionImpl
private static Map
private InetSocketAddress
private LinkedList<byte[]>
private AESemaphore
private static final int
private static final int
private InetSocketAddress
private static final int
private static final boolean
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
GenericMessageConnectionIndirect
(MessageManagerImpl _message_manager, String _msg_id, String _msg_desc, GenericMessageEndpoint _endpoint, long _connection_id) protected
GenericMessageConnectionIndirect
(MessageManagerImpl _message_manager, String _msg_id, String _msg_desc, GenericMessageEndpoint _endpoint, InetSocketAddress _rendezvous, InetSocketAddress _target) -
Method Summary
Modifier and TypeMethodDescriptionvoid
accepted()
void
addInboundRateLimiter
(RateLimiter limiter) void
addOutboundRateLimiter
(RateLimiter limiter) void
close()
protected void
void
connect
(ByteBuffer initial_data, GenericMessageConnectionAdapter.ConnectionListener listener) protected static String
getConnectionStatus
(Map connections) long
protected static String
int
protected static String
int
getType()
protected boolean
isClosed()
protected void
protected static void
protected boolean
prepareForKeepAlive
(boolean force) protected static Map
receive
(MessageManagerImpl message_manager, InetSocketAddress originator, Map message) protected List<byte[]>
protected boolean
void
removeInboundRateLimiter
(RateLimiter limiter) void
removeOutboundRateLimiter
(RateLimiter limiter) void
send
(PooledByteBuffer pbb) protected void
void
setOwner
(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:
setOwner
in interfaceGenericMessageConnectionAdapter
-
getMaximumMessageSize
public int getMaximumMessageSize()- Specified by:
getMaximumMessageSize
in interfaceGenericMessageConnectionAdapter
-
getType
- Specified by:
getType
in interfaceGenericMessageConnectionAdapter
-
getTransportType
public int getTransportType()- Specified by:
getTransportType
in interfaceGenericMessageConnectionAdapter
-
getLastMessageReceivedTime
public long getLastMessageReceivedTime() -
getEndpoint
- Specified by:
getEndpoint
in interfaceGenericMessageConnectionAdapter
-
getStartpoint
- Specified by:
getStartpoint
in interfaceGenericMessageConnectionAdapter
-
getConnection
- Specified by:
getConnection
in interfaceGenericMessageConnectionAdapter
-
addInboundRateLimiter
- Specified by:
addInboundRateLimiter
in interfaceGenericMessageConnectionAdapter
-
removeInboundRateLimiter
- Specified by:
removeInboundRateLimiter
in interfaceGenericMessageConnectionAdapter
-
addOutboundRateLimiter
- Specified by:
addOutboundRateLimiter
in interfaceGenericMessageConnectionAdapter
-
removeOutboundRateLimiter
- Specified by:
removeOutboundRateLimiter
in interfaceGenericMessageConnectionAdapter
-
connect
public void connect(ByteBuffer initial_data, GenericMessageConnectionAdapter.ConnectionListener listener) - Specified by:
connect
in interfaceGenericMessageConnectionAdapter
-
accepted
public void accepted()- Specified by:
accepted
in interfaceGenericMessageConnectionAdapter
-
send
- Specified by:
send
in interfaceGenericMessageConnectionAdapter
- Throws:
MessageException
-
send
-
receive
-
receiveIncomplete
protected boolean receiveIncomplete() -
close
- Specified by:
close
in interfaceGenericMessageConnectionAdapter
- Throws:
MessageException
-
close
- Throws:
MessageException
-
isClosed
protected boolean isClosed() -
prepareForKeepAlive
protected boolean prepareForKeepAlive(boolean force) -
keepAlive
protected void keepAlive() -
log
-
trace
-