Exemple #1
0
 public bool Run(int port)
 {
     // Mycommand comm = new Mycommand(, connectionString);
     ReLoad();
     DTUSer.weaveDeleteSocketListEvent += DTUSer_EventDeleteConnSoc;
     DTUSer.weaveUpdateSocketListEvent += DTUSer_EventUpdataConnSoc;
     DTUSer.weaveReceiveBitEvent       += DTUSer_receiveeventDtu;
     DTUSer.Start(port);
     System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(ReloadFliesdtu), null);
     return(true);
 }
Exemple #2
0
        public bool Run(string loaclIP, int port, int port2)
        {
            // Mycommand comm = new Mycommand(, connectionString);
            ReLoad();


            if (Wptype == WeavePortTypeEnum.Bytes)
            {
                p2psev.weaveReceiveBitEvent += P2psev_weaveReceiveBitEvent;
            }
            else
            {
                p2psev.waveReceiveEvent += p2psev_receiveevent;
            }

            p2psev.weaveUpdateSocketListEvent += p2psev_EventUpdataConnSoc;
            p2psev.weaveDeleteSocketListEvent += p2psev_EventDeleteConnSoc;
            //   p2psev.NATthroughevent += tcp_NATthroughevent;//p2p事件,不需要使用
            p2psev.Start(Convert.ToInt32(port));
            p2psev2 = new WeaveP2Server(loaclIP);
            p2psev2.weaveDeleteSocketListEvent += P2psev2_EventDeleteConnSoc;
            p2psev2.weaveUpdateSocketListEvent += P2psev2_EventUpdataConnSoc;
            p2psev2.waveReceiveEvent           += P2psev2_receiveevent;
            //   p2psev.NATthroughevent += tcp_NATthroughevent;//p2p事件,不需要使用
            p2psev2.Start(Convert.ToInt32(port2));
            if (EventMylog != null)
            {
                EventMylog("连接", "连接启动成功");
            }
            return(true);
        }
Exemple #3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            WeaveP2Server wp2p = new WeaveP2Server();

            wp2p.waveReceiveEvent += Wp2p_waveReceiveEvent;
            wp2p.Start(8989);
        }
Exemple #4
0
        static void Main(string[] args)
        {
            wudp.weaveUpdateSocketListEvent += Wudp_weaveUpdateSocketListEvent;
            wudp.weaveDeleteSocketListEvent += Wudp_weaveDeleteSocketListEvent;
            wudp.weaveReceiveBitEvent       += Wudp_weaveReceiveBitEvent;
            wudp.Start(60001);
            //wudp2p.waveReceiveEvent += Wudp2p_waveReceiveEvent;
            //wudp2p.Start(60002);
            //  wudpweb.weaveUpdateSocketListEvent += Wudpweb_weaveUpdateSocketListEvent;
            //wudpweb.weaveDeleteSocketListEvent += Wudpweb_weaveDeleteSocketListEvent;
            wudpweb.waveReceiveEvent += Wudpweb_waveReceiveEvent;
            wudpweb.Start(18181);


            System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(zhuangtai), null);
            Console.ReadLine();
        }
Exemple #5
0
        private void StartListen_button_Click(object sender, RoutedEventArgs e)
        {
            int port = int.Parse(Port_textBox.Text);

            wudp = new WeaveP2Server();
            wudp.waveReceiveEvent           += Wudp_waveReceiveEvent;
            wudp.weaveUpdateSocketListEvent += Wudp_weaveUpdateSocketListEvent;
            wudp.weaveDeleteSocketListEvent += Wudp_weaveDeleteSocketListEvent;


            wudp.Start(port);


            StartListen_button.IsEnabled = false;

            StopListen_button.IsEnabled = true;
        }
        /// <summary>
        /// 读取WeavePortTypeEnum类型后,初始化 new WeaveP2Server("127.0.0.1"),并添加端口;
        /// </summary>
        /// <param name="WeaveServerPort"></param>
        public void StartServer(WeaveServerPort _ServerPort)
        {
            // WeaveTcpToken weaveTcpToken = new WeaveTcpToken();

            P2Server = new WeaveP2Server("127.0.0.1");

            P2Server.waveReceiveEvent           += P2ServerReceiveHander;
            P2Server.weaveUpdateSocketListEvent += P2ServerUpdateSocketHander;
            P2Server.weaveDeleteSocketListEvent += P2ServerDeleteSocketHander;
            //   p2psev.NATthroughevent += tcp_NATthroughevent;//p2p事件,不需要使用
            P2Server.Start(_ServerPort.Port);      //myI.Parameter[4]是端口号

            TcpToken.PortType = _ServerPort.PortType;
            TcpToken.P2Server = P2Server;
            TcpToken.IsToken  = _ServerPort.IsToken;
            TcpToken.WPTE     = _ServerPort.PortType;

            // TcpToken = weaveTcpToken;

            // P2Server = p2psev;
        }
Exemple #7
0
 private void Form1_Load(object sender, EventArgs e)
 {
     wp2ser.weaveReceiveBitEvent += Wp2ser_weaveReceiveBitEvent;//接收
     wp2ser.Start(8989);
 }