Esempio n. 1
0
        private void InitServiceHost()
        {
            var dataServerConnector = new DataServerConnector(_settingsManager, _storage, _logger);

            _serviceHost = new ServiceHost(
                dataServerConnector,
                new Uri(Adress));
            //_serviceHost.
            _serviceHost.AddServiceEndpoint(
                typeof(IDataServerContract),
                _settingsManager.CentralServerRemoteBinding,
                "");
        }
Esempio n. 2
0
        public DataServerRunnable(ICore core, ISettingsManager settingsManager, IStorage storage, ILogger logger) : base(core, logger)
        {
            _settingsManager = settingsManager;
            _storage         = storage;
            _logger          = logger;
            do
            {
                _addres = string.Format("net.tcp://localhost:{0}", DateTime.Now.Millisecond % 10000);
            } while (_addres == settingsManager.CentralServerRemoteAdress);

            var dataServerConnector = new DataServerConnector(settingsManager, storage, logger);

            _serviceHost = new ServiceHost(
                dataServerConnector,
                new Uri(Adress));
            //_serviceHost.
            _serviceHost.AddServiceEndpoint(
                typeof(IDataServerContract),
                _settingsManager.CentralServerRemoteBinding,
                "");
        }