void finishConnect() { Socket socket = socketChannel.socket(); InetSocketAddress local = (InetSocketAddress) socket.getLocalSocketAddress(); InetSocketAddress remote = (InetSocketAddress) socket.getRemoteSocketAddress(); connection.onConnect(new ConnectionSession(local, remote)); }
@Override public void onConnect(ConnectionSession session) { established = true; if (logLevel < LOG_DEBUG) { return; } String local = session.getLocalAddr() + ":" + session.getLocalPort(); String remote = session.getRemoteAddr() + ":" + session.getRemotePort(); if (reverse) { send = ", " + remote + " <= " + local; recv = ", " + remote + " => " + local; } else { send = ", " + local + " => " + remote; recv = ", " + local + " <= " + remote; } Log.d("Mux Connection Established" + (reverse ? recv : send)); }
byte[] localAddrBytes = session.getLocalSocketAddress().getAddress().getAddress(); byte[] remoteAddrBytes = session.getRemoteSocketAddress().getAddress().getAddress(); int len = HEAD_SIZE + 5 + localAddrBytes.length + remoteAddrBytes.length; byte[] b; (session instanceof SSLConnectionSession ? MuxPacket.SESSION_SSL : 0)); System.arraycopy(localAddrBytes, 0, b, HEAD_SIZE + 1, localAddrBytes.length); Bytes.setShort(session.getLocalPort(), b, HEAD_SIZE + 1 + localAddrBytes.length); System.arraycopy(remoteAddrBytes, 0, b, HEAD_SIZE + 3 + localAddrBytes.length, localAddrBytes.length); Bytes.setShort(session.getRemotePort(), b, HEAD_SIZE + 3 + localAddrBytes.length + remoteAddrBytes.length); MuxPacket.send(mux.handler, b, MuxPacket.CONNECTION_CONNECT, cid); return; String local = session.getLocalAddr() + ":" + session.getLocalPort(); String remote = session.getRemoteAddr() + ":" + session.getRemotePort(); send = ", " + remote + "<-" + local; recv = ", " + remote + "->" + local;
super.onConnect(new SSLConnectionSession(session.getLocalSocketAddress(), session.getRemoteSocketAddress(), ssle.getSession())); boolean closed = false; if (baqRecv.length() > 0) {
@Override public void onConnect(ConnectionSession session) { if (contains(session.getRemoteAddr())) { super.onConnect(session); } else { disconnect(); onDisconnect(); } } };
@Override public void onConnect(ConnectionSession session) { remoteAddr = session.getRemoteAddr(); connected = true; int[] connections__ = getData(connectionsMap, 1); connections__[0] ++; checkTimeout(); int[] requests__ = getData(requestsMap, 2); requests__[0] ++; if ((connections_ > 0 && connections__[0] > connections_) || (requests_ > 0 && requests__[0] > requests_)) { onBlock(this, remoteAddr, connections__[0], requests__[0], 0); } else { super.onConnect(session); } }
@Override public void onConnect(ConnectionSession session) { established = true; if (logLevel < LOG_DEBUG) { return; } String local = session.getLocalAddr() + ":" + session.getLocalPort(); String remote = session.getRemoteAddr() + ":" + session.getRemotePort(); if (reverse) { send = ", " + local + " => " + remote; recv = ", " + local + " <= " + remote; } else { send = ", " + remote + " <= " + local; recv = ", " + remote + " => " + local; } Log.d("Mux Connection Established" + (reverse ? send : recv)); }
InetSocketAddress localIsa = new InetSocketAddress(localAddress, localPort); InetSocketAddress remoteIsa = new InetSocketAddress(remoteAddress, remotePort); connection.onConnect(ssls == null ? new ConnectionSession(localIsa, remoteIsa) : new SSLConnectionSession(localIsa, remoteIsa, ssls)); if (logLevel < LOG_DEBUG) {
@Override public void onConnect(ConnectionSession session) { if (useClientMode) { host = session.getLocalAddr(); port = session.getLocalPort(); } else { host = session.getRemoteAddr(); port = session.getRemotePort(); } if (dumpFolder != null) { try { out = new PrintStream(getOutputStream(".txt"), true); outSent = getOutputStream("_sent.bin"); outRecv = getOutputStream("_recv.bin"); } catch (IOException e) { dumpFolder = null; } } printfln("[%s:%s Connected at %s]", host, "" + port, now()); // Dump Before Consume super.onConnect(session); }