Esempio n. 1
0
 public void Dispose()
 {
     if (_server != null)
     {
         _server.Stop();
         _server = null;
     }
     _messageQueue.Clear();
 }
Esempio n. 2
0
        public void init_servers()
        {
            string portString = Utilities.getPortFromUrl(url);
            string hostName   = Utilities.getHostNameFromUrl(url);
            int    port;

            int.TryParse(portString, out port);
            Server server = new Server
            {
                Services = { ServerCommunicationService.BindService(new ServerCommunicationLogic(this)), DataStoreService.BindService(new DataStoreServiceImpl(this)) },
                Ports    = { new ServerPort(hostName, port, ServerCredentials.Insecure) }
            };

            server.Start();
        }
Esempio n. 3
0
        private void StartServerCommunication()
        {
            _server = new ServerCommunicationService();

            if (_useLogging)
            {
                ILoggerService loggerService = new LoggerService();
                _server.CurrentLogLevel = LogLevel.Info;
                _server.LogFileName     = @"c:\server.txt";
                _server.LoggerService   = loggerService;
            }

            _server.MulticastIPAddress = ConfigurationManager.AppSettings["MulticastIPAddress"];
            _server.MulticastPort      = Int32.Parse(ConfigurationManager.AppSettings["MulticastPort"]);
            _server.ServerPort         = Int32.Parse(ConfigurationManager.AppSettings["ServerPort"]);
            _server.DataReceived      += new EventHandler <DataReceivedEventArgs>(_server_DataReceived);
            _server.Start();
        }