delete() private method

private delete ( ) : void
return void
Esempio n. 1
0
        internal static void delPort(Session session, String address, int lport)
        {
            PortWatcher pw = getPort(session, address, lport);

            if (pw == null)
            {
                throw new JSchException("PortForwardingL: local port " + address + ":" + lport + " is not registered.");
            }
            pw.delete();
            pool.Remove(pw);
        }
Esempio n. 2
0
 internal static void delPort(Session session)
 {
     lock (pool)
     {
         PortWatcher[] foo   = new PortWatcher[pool.Count];
         int           count = 0;
         for (int i = 0; i < pool.Count; i++)
         {
             PortWatcher p = (PortWatcher)(pool[i]);
             if (p.session == session)
             {
                 p.delete();
                 foo[count++] = p;
             }
         }
         for (int i = 0; i < count; i++)
         {
             PortWatcher p = foo[i];
             pool.Remove(p);
         }
     }
 }
Esempio n. 3
0
 internal static void delPort(Session session)
 {
     lock (pool)
     {
         PortWatcher[] foo   = new PortWatcher[pool.size()];
         int           count = 0;
         for (int i = 0; i < pool.size(); i++)
         {
             PortWatcher p = (PortWatcher)(pool.elementAt(i));
             if (p.session == session)
             {
                 p.delete();
                 foo[count++] = p;
             }
         }
         for (int i = 0; i < count; i++)
         {
             PortWatcher p = foo[i];
             pool.removeElement(p);
         }
     }
 }