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 }
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); }
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); } }
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()); } }
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); } }
public void Init(LRM linkResourceManager) { lrm = linkResourceManager; //this.CallController = new NCC(this, linkResourceManager); }