Ejemplo n.º 1
0
        private void heartbeatThreadStart()
        {
            BroadcastModel.log.Trace("heartbeatThreadStart ");
            while (this.broadcastSocket != null)
            {
                byte type = 0;
                switch (ConfigureUtil.getClientType())
                {
                case ClientType.TYPE_A:
                    type = 1;
                    break;

                case ClientType.TYPE_B:
                    type = 2;
                    break;

                case ClientType.TYPE_C:
                    type = 3;
                    break;

                case ClientType.TYPE_D:
                    type = 4;
                    break;
                }
                byte[] data = new byte[]
                {
                    type
                };
                this.send(this.HEARTBEAT, data);
                Thread.Sleep(1000);
            }
        }
Ejemplo n.º 2
0
        public void send(int msg)
        {
            BroadcastModel.log.Trace("send " + msg);
            this.message = msg;
            byte type = 0;

            switch (ConfigureUtil.getClientType())
            {
            case ClientType.TYPE_A:
                type = 1;
                break;

            case ClientType.TYPE_B:
                type = 2;
                break;

            case ClientType.TYPE_C:
                type = 3;
                break;

            case ClientType.TYPE_D:
                type = 4;
                break;
            }
            byte[] data = new byte[]
            {
                type
            };
            this.send(this.MESSAGE, this.appendData(data, msg));
        }
Ejemplo n.º 3
0
 public ControlCheckWindow()
 {
     ControlCheckWindow.log.Trace("ControlCheckWindow");
     this.InitializeComponent();
     ControlCheckWindow.log.Trace("after ControlCheckWindow");
     this.connectModel = new ConnectModel(this);
     this.connectModel.setConnectStatusCallback(this);
     this.OnWirelessFinishListener = new ControlCheckWindow.OnWirelessFinishDelegate(this.OnWirelessFinish);
     this.socketModel = new SocketModel(this);
     this.addSocketCallback();
     this.initView();
     ControlCheckWindow.log.Trace("ip == " + ConfigureUtil.AdapterIP());
     ControlCheckWindow.log.Trace("type = " + ConfigureUtil.getClientType());
 }