Spinach.SwarmMemory.removePermissionRec C# (CSharp) Method

removePermissionRec() public method

public removePermissionRec ( string IPPort ) : void
IPPort string
return void
        public void removePermissionRec(string IPPort)
        {
            lock (this)
            {
                try
                {
                    if (permissions.Contains(IPPort))
                    {
                        if (IPPort == owner)
                        {
                            if (CloseP != null)
                                CloseP(true);
                        }
                        else if (IPPort == Master)
                        {
                            AsynchronousSocketListener msocket = conn.getSocket();
                            if ((msocket.GetIP() + ":" + msocket.GetPort()) == BackUp)
                            {
                                permissions.Remove(IPPort);
                                BuildList();
                                if (RerunP != null)
                                    RerunP(true);//ask UI call ReRunClicked()

                            }
                        }
                        else if (IPPort == BackUp)
                        {
                            permissions.Remove(IPPort);
                            BuildList();
                            BackUp = selectBackUp();
                            AsynchronousSocketListener msocket = conn.getSocket();
                            if ((msocket.GetIP() + ":" + msocket.GetPort()) == Master)
                            {
                                PeerGone(IPPort);
                            }

                        }
                        else
                        {
                            permissions.Remove(IPPort);
                            BuildList();
                            AsynchronousSocketListener msocket = conn.getSocket();
                            if ((msocket.GetIP() + ":" + msocket.GetPort()) == Master)
                            {
                                PeerGone(IPPort);
                            }
                        }
                    }
                }
                catch (Exception e)
                { Console.WriteLine(e.ToString()); }
            }
        }
        //public void deleteReply(string IPP)