public static void del(Channel c) { lock (pool) { pool.removeElement(c); } }
internal static void del(Channel c) { lock (pool) { pool.removeElement(c); } }
public static void delPort(Session session, int rport) { lock (pool) { Object[] foo = null; for (int i = 0; i < pool.size(); i++) { Object[] bar = (Object[])(pool.elementAt(i)); if (bar[0] != session) { continue; } if (((Integer)bar[1]).intValue() != rport) { continue; } foo = bar; break; } if (foo == null) { return; } pool.removeElement(foo); } Buffer buf = new Buffer(100); // ?? Packet packet = new Packet(buf); try { // byte SSH_MSG_GLOBAL_REQUEST 80 // string "cancel-tcpip-forward" // boolean want_reply // string address_to_bind (e.g. "127.0.0.1") // uint32 port number to bind packet.reset(); buf.putByte((byte)80 /*SSH_MSG_GLOBAL_REQUEST*/); buf.putString(new Str("cancel-tcpip-forward").getBytes()); buf.putByte((byte)0); buf.putString(new Str("0.0.0.0").getBytes()); buf.putInt(rport); session.write(packet); } catch (Exception e) { // throw new JSchException(e.toString()); } }