示例#1
0
        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));
        }
示例#2
0
        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));
        }
示例#3
0
文件: Node_.cs 项目: erow/fcp_c-
 public void setGateway(Node_ top)
 {
     m_gateway = top;
 }