Example #1
0
        private void tslStartSimulator_Click(object sender, EventArgs e)
        {
            frmSendMessage oFrmSendMessage = new frmSendMessage();

            if (oFrmSendMessage.ShowDialog() != DialogResult.OK)
            {
                this._port               = GlobeVariables.DefaultReceivePort;
                this._interval           = GlobeVariables.DefaultSendInterval;
                this._simulatedCarNumner = GlobeVariables.DefaultCarNumber;
            }
            else
            {
                this._interval           = oFrmSendMessage.Interval;
                this._port               = oFrmSendMessage.Port;
                this._simulatedCarNumner = oFrmSendMessage.SimulatedCarNumber;
            }

            this._socketServer.Intervalue         = this._interval;
            this._socketServer.RemoteLiseningPort = this._port;
            this._socketServer.StartSendMessage();

            this.tlsStartSimulator.Enabled = false;
            this.tlsStopSimulator.Enabled  = true;
            this.lblServerInfos.Text       = string.Format("接收端口:{0}    间隔时间:{1}毫秒", this._port.ToString(), this._interval.ToString());
        }
Example #2
0
        private void tslStartSimulator_Click(object sender, EventArgs e)
        {
            frmSendMessage oFrmSendMessage = new frmSendMessage();

            if (oFrmSendMessage.ShowDialog() != DialogResult.OK)
            {
                this._port = GlobeVariables.DefaultReceivePort;
                this._interval = GlobeVariables.DefaultSendInterval;
                this._simulatedCarNumner = GlobeVariables.DefaultCarNumber;
            }
            else
            {
                this._interval = oFrmSendMessage.Interval;
                this._port = oFrmSendMessage.Port;
                this._simulatedCarNumner = oFrmSendMessage.SimulatedCarNumber;
            }

            this._socketServer.Intervalue = this._interval;
            this._socketServer.RemoteLiseningPort = this._port;
            this._socketServer.StartSendMessage();

            this.tlsStartSimulator.Enabled = false;
            this.tlsStopSimulator.Enabled = true;
            this.lblServerInfos.Text = string.Format("接收端口:{0}    间隔时间:{1}毫秒", this._port.ToString(), this._interval.ToString());
        }