Ejemplo n.º 1
0
        public ContainerPort ReservePort(ushort suggestedPort)
        {
            rwlock.EnterUpgradeableReadLock();
            try
            {
                if (port == null)
                {
                    rwlock.EnterWriteLock();
                    try
                    {
                        port = new ContainerPort(suggestedPort, this.user);
                    }
                    finally
                    {
                        rwlock.ExitWriteLock();
                    }
                }
                else
                {
                    log.Trace("Container '{0}' already assigned port '{1}'", handle, port);
                }
            }
            finally
            {
                rwlock.ExitUpgradeableReadLock();
            }

            return(port);
        }
Ejemplo n.º 2
0
 public static void CleanUp(string handle)
 {
     ContainerUser.CleanUp(handle);
     ContainerDirectory.CleanUp(handle);
     ContainerPort.CleanUp(handle, 0); // TODO
 }