public void addSubscribe(string dst_uri, Node_ node) { Logger.DebugFormat("-----------------\nSubscribe from:%s to: %s\n", m_deal, dst_uri); int n = -1; foreach (var t in m_table) { if (Path.belong(t.Item1, "subscriber")) { string number = t.Item1.Split(':')[1]; int num = Int32.Parse(number); n = Math.Max(num, n); } } string call_uri = "subscriber:" + (n + 1); FcpMessage msg = new FcpMessage(); msg.DstUri = (m_path.abs_uri(dst_uri)); msg.SrcUri = (m_path.abs_uri(call_uri)); msg.Type = (FcpType.Subscribe); //msg.Data(""); sendMsg(msg); m_table.Add(new Tuple <string, Node_>(call_uri, node)); }
public void addNode(string path, Node_ node) { int n = -1; foreach (var t in m_table) { if (Path.belong(t.Item1, path)) { string number = t.Item1.Split(':')[1]; int num = Int32.Parse(number); n = Math.Max(num, n); } } string node_uri = path + ":" + (n + 1); m_table.Add(new Tuple <string, Node_>(node_uri, node)); node.setGateway(this); node.m_path = new Path(m_path.abs_uri(node_uri)); }
public void setGateway(Node_ top) { m_gateway = top; }