Exemplo n.º 1
0
        static void Main(string[] args)
        {
            p2psever server = new p2psever();

            server.receiveevent += Server_receiveevent;
            server.start(8989);


            Console.WriteLine("8989listen:");
            Console.ReadKey();
        }
Exemplo n.º 2
0
        public bool Run(MyInterface.MyInterface myI)
        {
            // Mycommand comm = new Mycommand(, connectionString);



            ReloadFlies();

            p2psev = new p2psever(myI.Parameter[3]);

            p2psev.receiveevent       += p2psev_receiveevent;
            p2psev.EventUpdataConnSoc += p2psev_EventUpdataConnSoc;
            p2psev.EventDeleteConnSoc += p2psev_EventDeleteConnSoc;
            //   p2psev.NATthroughevent += tcp_NATthroughevent;//p2p事件,不需要使用
            p2psev.start(Convert.ToInt32(myI.Parameter[4])); //myI.Parameter[4]是端口号
            qt.Add("onlinetoken", onlines);                  //初始化一个队列,记录在线人员的token
            if (EventMylog != null)
            {
                EventMylog("连接", "连接启动成功");
            }
            return(true);
        }
Exemplo n.º 3
0
        public bool Run(string loaclIP, int port, int port2)
        {
            // Mycommand comm = new Mycommand(, connectionString);
            ReLoad();

            p2psev.receiveevent       += p2psev_receiveevent;
            p2psev.EventUpdataConnSoc += p2psev_EventUpdataConnSoc;
            p2psev.EventDeleteConnSoc += p2psev_EventDeleteConnSoc;
            //   p2psev.NATthroughevent += tcp_NATthroughevent;//p2p事件,不需要使用
            p2psev.start(Convert.ToInt32(port));
            p2psev2 = new p2psever(loaclIP);
            p2psev2.EventDeleteConnSoc += P2psev2_EventDeleteConnSoc;
            p2psev2.EventUpdataConnSoc += P2psev2_EventUpdataConnSoc;
            p2psev2.receiveevent       += P2psev2_receiveevent;
            //   p2psev.NATthroughevent += tcp_NATthroughevent;//p2p事件,不需要使用
            p2psev2.start(Convert.ToInt32(port2));
            if (EventMylog != null)
            {
                EventMylog("连接", "连接启动成功");
            }
            return(true);
        }