Пример #1
0
        public bool Init()
        {
            var factory = new SocketServerFactroy(_ipString, _port, _log, _timeOut, _readCacheSize, _maxConnect);

            _socketServer = factory.CreateInstance(_socketServerType);
            if (_socketServer.Init())
            {
                _socketServer.ReadComplete    += recivceDataHanding;
                _socketServer.SendComplete    += sendComplete;
                _socketServer.DisconnectEvent += disconnectEvent;
                return(true);
            }
            return(false);
        }
Пример #2
0
        public bool Init()
        {
            _mapping = ModbusPointMapping.GetInstance(_log);

            var factory = new SocketServerFactroy(_ipString, _port, _log, _timeOut, readCacheSize, _maxConnect);

            _socketServer = factory.CreateInstance(_socketServerType);
            if (_socketServer.Init())
            {
                _socketServer.ReadComplete += recivceDataHanding;
                _socketServer.SendComplete += sendComplete;
                return(true);
            }
            return(false);
        }