@Override public void onDisconnect() { if (peer != null) { peer.peer = null; peer.handler.disconnect(); } } }
/** Wraps active disconnecting events, from the application side to the network side */ @Override public void disconnect() { handler.disconnect(); } }
void disconnect() { activeClose = true; handler.disconnect(); onDisconnect(); } }
public OriginServer(ServerConnection server, MuxContext context) { this.server = server; this.context = context; closeable = context.scheduleDelayed(() -> { long now = System.currentTimeMillis(); Iterator<OriginMuxConnection> i = timeoutSet.iterator(); OriginMuxConnection mux; while (i.hasNext() && now > (mux = i.next()).accessed + 60000) { i.remove(); mux.handler.disconnect(); } }, 1000, 1000); }
void disconnect() { activeClose = true; handler.disconnect(); onDisconnect(); } }
@Override public void onDisconnect() { for (TerminalConnection connection : connectionMap. values().toArray(EMPTY_CONNECTIONS)) { // "conn.onDisconnect()" might change "connectionMap" connection.activeClose = true; connection.handler.disconnect(); } if (logLevel >= LOG_DEBUG) { Log.d(!established ? "Mux Connection Failed" : activeClose ? "Mux Connection Disconnected" + send : "Mux Connection Lost" + recv); } }
@Override public void onRecv(byte[] b, int off, int len) { if (b[len - 1] == 0) { loadPolicy(); handler.send(policyBytes); handler.disconnect(); } } };
@Override public void onConnect(ConnectionSession session) { peer = new PeerConnection(this); Connection connection = peer; for (Supplier<? extends ConnectionFilter> serverFilter : forward.serverFilters) { connection = connection.appendFilter(serverFilter.get()); } try { forward.connector.connect(connection, forward.host, forward.port); } catch (IOException e) { peer = null; handler.disconnect(); } } }
cid = mux.idPool.borrowId(); if (cid < 0) { handler.disconnect(); if (logLevel >= LOG_DEBUG) { Log.d("Unable to Allocate Connection ID !!!");
idPool.returnId(cid); connection.activeClose = true; connection.handler.disconnect(); if (logLevel >= LOG_VERBOSE) { Log.v("HANDLER_DISCONNECT: #" + cid + connection.send + recv);