コード例 #1
0
ファイル: RC.cs プロジェクト: sopel30/tsst2
 public RC(Manager manager, LRM linkResourceManager, CC cc)
 {
     this.manager = manager;
     this.lrm = linkResourceManager;
     this.ConnectionController = cc;
     //musi byc kopiowany, bo jak porty beda zajete to trzeba bedzie usunac dana krawedz
 }
コード例 #2
0
ファイル: RC.cs プロジェクト: admsbk/tsst2
 public RC(Manager manager, LRM linkResourceManager, CC cc)
 {
     this.manager = manager;
     this.lrm     = linkResourceManager;
     this.ConnectionController = cc;
     //musi byc kopiowany, bo jak porty beda zajete to trzeba bedzie usunac dana krawedz
 }
コード例 #3
0
 public NCC(Manager manager, LRM linkResourceManager, networkLibrary.transportClient client, MainWindow window)
 {
     this.manager         = manager;
     this.network         = client;
     ConnectionController = new CC(this.network, window);
     this.lrm             = linkResourceManager;
     this.rc = new RC(manager, linkResourceManager, ConnectionController);
 }
コード例 #4
0
ファイル: NCC.cs プロジェクト: sopel30/tsst2
 public NCC(Manager manager, LRM linkResourceManager, networkLibrary.transportClient client, MainWindow window)
 {
     this.manager = manager;
     this.network = client;
     ConnectionController = new CC(this.network, window);
     this.lrm = linkResourceManager;
     this.rc = new RC(manager, linkResourceManager, ConnectionController);
 }
コード例 #5
0
 private void SendLinkAllocationRequest(string header)
 {
     numberlrm = path.Length;
     for (int a = 0; a < path.Length; a++)
     {
         string message = null;
         message = MessageNames.LINK_CONNECTION_REQUEST + " " + header;
         LRM act = LinksRM.Find(LRM => LRM.IdLRM == Int32.Parse(path[a]));
         NewLog($"{CCiPAddress} Send LinkAllocation do lrm adres{act.IPAddressLRM}", myWindow);
         SendingMessage(act.IPAddressLRM, message);
     }
 }
コード例 #6
0
        public ConnectionController(int numberDomain, SubnetworkLogs tmp)
        {
            myWindow       = tmp;
            numberDomainCC = numberDomain;
            XmlReader reader = new XmlReader("CC" + numberDomain + ".xml");

            CCiPAddress  = IPAddress.Parse(reader.GetAttributeValue("config", "IP_ADDRESS"));
            RCiPAddress  = IPAddress.Parse(reader.GetAttributeValue("config", "IP_ADDRESS_RC"));
            NCCiPAddress = IPAddress.Parse(reader.GetAttributeValue("config", "IP_ADDRESS_NCC"));
            other_cc     = reader.GetAttributeValue("config", "OTHER_CC_ADDRESS");
            LinksRM      = new List <LRM>();
            int numberoflrm = reader.GetNumberOfItems("LRM");

            for (int a = 0; a < numberoflrm; a++)
            {
                LRM lRM = new LRM(CCiPAddress, RCiPAddress, myWindow);
                lRM.IdLRM        = Int32.Parse(reader.GetAttributeValue(a, "LRM", "ID"));
                lRM.IPAddressLRM = reader.GetAttributeValue(a, "LRM", "IP_ADDRESS");
                LinksRM.Add(lRM);
                Task.Run(() => lRM.ReceiveMessage());
            }
        }
コード例 #7
0
ファイル: AdministrativeDomain.cs プロジェクト: admsbk/tsst2
        public void readConfig(string xmlConfigPath, string xmlTopologyPath)
        {
            try
            {
                networkLibrary.Config conf = new Config(xmlConfigPath, Constants.AD);
                nccname             = conf.config[0];
                linkResourceManager = new LRM(conf.config[3], window.links);
                linkResourceManager.loadTopology(xmlTopologyPath);

                CloudIp        = conf.config[1];
                this.CloudPort = conf.config[2];
                this.domain    = conf.config[3];
                neighbours     = conf.neighbours;
                parents        = conf.parent;
                children       = conf.child;
                addLog(window.logList, networkLibrary.Constants.CONFIG_OK, networkLibrary.Constants.LOG_INFO);
            }
            catch (Exception e)
            {
                addLog(window.logList, networkLibrary.Constants.CONFIG_ERROR, networkLibrary.Constants.LOG_ERROR);
                Console.WriteLine(e.StackTrace);
            }
        }
コード例 #8
0
 public void Init(LRM linkResourceManager)
 {
     lrm = linkResourceManager;
     //this.CallController = new NCC(this, linkResourceManager);
 }
コード例 #9
0
ファイル: AdministrativeDomain.cs プロジェクト: sopel30/tsst2
        public void readConfig(string xmlConfigPath, string xmlTopologyPath)
        {
            try
            {
                networkLibrary.Config conf = new Config(xmlConfigPath, Constants.AD);
                nccname = conf.config[0];
                linkResourceManager = new LRM(conf.config[3], window.links);
                linkResourceManager.loadTopology(xmlTopologyPath);

                CloudIp = conf.config[1];
                this.CloudPort = conf.config[2];
                this.domain = conf.config[3];
                neighbours = conf.neighbours;
                parents = conf.parent;
                children = conf.child;
                addLog(window.logList, networkLibrary.Constants.CONFIG_OK, networkLibrary.Constants.LOG_INFO);
            }
            catch (Exception e)
            {
                addLog(window.logList, networkLibrary.Constants.CONFIG_ERROR, networkLibrary.Constants.LOG_ERROR);
                Console.WriteLine(e.StackTrace);
            }
        }