示例#1
0
        private int TcpBufferSize = 65536;//缓冲区大小

        private FigKeySocketServer(FigKeyConfig config, List <Device> devList, List <Client> clnList)
        {
            this.fkconfig = config;
            this.devList  = devList;
            this.clnList  = clnList;
            clnHandler    = new ClientHandler(clnList, this);
            devHandler    = new DeviceHandler(devList, this);

            //监听设备socket
            tcpStateList    = new List <DeviceTcpState>();
            devSocketServer = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            devicePort      = ConfigurationManager.AppSettings["devicePort"].ToString();
            IPEndPoint ipEndPoint = new IPEndPoint(IPAddress.Any, Convert.ToInt32(devicePort));

            devSocketServer.Bind(ipEndPoint);
        }
 public ClientHandler(List <Client> clnList, FigKeySocketServer socketServer)
 {
     this.clnList      = clnList;
     this.socketServer = socketServer;
     devHandler        = socketServer.devHandler;
 }