Пример #1
0
        void OnConnected(TcpSocketClient client)
        {
            client.Start();

            ThreadCalls(() =>
            {
                client.Send(new Bind()
                {
                    SequenceNumber = Sequence.Next(),
                    LoginType      = LoginTypes.SPToSMG,
                    LoginName      = cbbSPNumber.Text,
                    LoginPassword  = cbbSPNumber.Text
                }.GetBytes());

                cbbSPNumber.Enabled = false;
                cbbSMGIP.Enabled    = false;
                nudSMGPort.Enabled  = false;
                btnStart.Enabled    = false;
                btnStop.Enabled     = true;
                btnSend.Enabled     = true;

                lbStatus.Text  = "已连接";
                lbAddress.Text = client.LocalIPAddress;
                this.Text      = cbbSPNumber.Text;
            });
        }