Esempio n. 1
0
 public void Dispose()
 {
     if (_server != null)
     {
         _server.Stop();
         _server = null;
     }
     _messageQueue.Clear();
 }
Esempio n. 2
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();
        }