using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using SocketsTCPIPServer;
namespace TCP测试
{
    public partial class Form1 : Form
    {
        CServerTCPIP cst;
        public Form1()
        {
            InitializeComponent();
            cst = new CServerTCPIP();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            
            cst.StartListen();
        }

        

        private void button2_Click(object sender, EventArgs e)
        {
            byte[] sm = new byte[6] { 70,0,2,3,5,0};

            sm[2] =Convert.ToByte( Convert.ToInt32(this.tbMonitorTask.Text) & 255);
            sm[3] =Convert.ToByte( Convert.ToInt32(this.tbMonitorTask.Text) >> 8);
            sm[4] = Convert.ToByte(Convert.ToInt32(this.tbAgvNo.Text) & 255);
            sm[5] =Convert.ToByte( Convert.ToInt32(this.tbAgvNo.Text) >> 8);
            cst.ClientSocket.Send(sm);
        }
    }
}