/** Wraps queue events, from the network side to the application side */ @Override public void onQueue(int size) { connection.onQueue(size); }
private void block(int len, int fromLen) { if (fromLen > 0) { blocking = true; connection.onQueue(len); } }
private void unblock(int len, int fromLen) { if (len == fromLen) { return; } boolean fromBlocking = blocking; if (len == 0) { blocking = false; } if (fromBlocking) { connection.onQueue(len); } } }
@Override public void onQueue(int size) { if (logLevel >= LOG_VERBOSE) { Log.v("onQueue(" + size + ")" + send); } if (!context.isQueueStatusChanged(size, lastSize)) { return; } // Tell all virtual connections that mux is congested or smooth for (Connection connection : connectionMap. values().toArray(EMPTY_CONNECTIONS)) { // "connecton.onQueue()" might change "connectionMap" connection.onQueue(size); } if (logLevel >= LOG_DEBUG) { Log.d((size == 0 ? "All Virtual Connections Unblocked due to Smooth Mux" : "All Virtual Connections Blocked due to Congested Mux (" + size + ")") + send); } }