Example #1
0
 //管理socket的一系列操作
 void SocketManager(object sender)
 {
     try
     {
         TcpBussiness.DelClosSocket(tcp, 120);
     }
     catch (Exception ex)
     {
         Service.ServiceControl.log.Error(DateTime.Now + "管理socket出现异常!" + ex.ToString());
     }
 }
Example #2
0
 //回复数据的方法
 void SendData(object sender)
 {
     try
     {
         TcpBussiness.SendCommand(tcp);
         //TcpBussiness.SendData(tcp);
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #3
0
        public void Start()
        {
            Ts_Init();
            if (!IsOpen)
            {
                socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
                socket.Bind(new IPEndPoint(IPAddress.Parse(IP), PORT));
                socket.Listen(5000);
                socket.BeginAccept(new AsyncCallback(OnConnectRequest), socket);

                IsOpen = true;

                TcpBussiness.ToQtsd();
            }
        }
Example #4
0
 //回复数据的方法
 void SendData()
 {
     while (true)
     {
         try
         {
             TcpBussiness.SendCommand(tcp);
             //TcpBussiness.SendData(tcp);
         }
         catch (Exception ex)
         {
             Service.ServiceControl.log.Error(DateTime.Now + ex.ToString());
         }
         Thread.Sleep(500);
     }
 }
Example #5
0
 //管理socket的一系列操作
 void SocketManager(object sender)
 {
     TcpBussiness.DelClosSocket(tcp, 60);
 }