using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;

namespace WebApi.Models
{
    public class TightenTool
    {
        public readonly object TcpClientLock = new object();
        /// <summary>
        ///  工位号
        /// </summary>
        public string OpName
        {
            get;
            set;
        }
        /// <summary>
        ///  拧紧枪名称
        /// </summary>
        public string Name
        {
            get;
            set;
        }
        /// <summary>
        ///  IP
        /// </summary>
        public string IP
        {
            get;
            set;
        }
        /// <summary>
        ///  端口号
        /// </summary>
        public string Port
        {
            get;
            set;
        }

        /// <summary>
        ///  TPC客户端
        /// </summary>
        public TcpClient TcpClient
        {
            get;
            set;
        }

        /// <summary>
        /// 安全判断TcpClient是否已连接
        /// </summary>
        public bool IsConnected
        {
            get { return TcpClient != null && TcpClient.Connected; }
        }
    }
}
