private void OnStartCommunications(object sender, System.EventArgs e) { if (!channelManager.IsClosed) { if (log.IsWarnEnabled) { log.Warn("Server is already started."); } return; } if (channelManager.IsClosed) { if (protocolMngr == null) { protocolMngr = new InteractionManager(new DescriptorManager(), channelManager); protocolMngr.PeerName = peerName; protocolMngr.PeerDescription = peerDescription; } channelManager.Start(); } if (app.IsListener) { foreach (ConnectionInfo listener in app.GetTCPListenerInfoList()) { channelManager.StartNewListener(listener); } foreach (ConnectionInfo channel in app.UDPChannelsInfoList) { channelManager.StartNewUDPLocalChannel(channel); } } foreach (string uri in app.ReliableConnectionList) { try { channelManager.StartNewConnection(new Uri(uri)); } catch (Exception ex) { if (log.IsErrorEnabled) { log.Error("Error connecting " + uri + ". Exception: " + ex.Message); } } } foreach (string uri in app.BestEffortConnectionList) { try { channelManager.StartNewConnection(new Uri(uri)); } catch (Exception ex) { if (log.IsErrorEnabled) { log.Error("Error connecting " + uri + ". Exception: " + ex.Message); } } } }