public void StartListening(int port, string snippetDataBaseName) { // Call this only for the default appdomain Debug.Assert(AppDomain.CurrentDomain.IsDefaultAppDomain()); // and only after initialization Debug.Assert(domainPool != null); var repository = new SnippetDataRepository(snippetDataBaseName); var hostServer = new SimpleHostServer(repository, domainPool); var hostServerThread = new Thread(() => hostServer.StartListening()); hostServerThread.Priority = ThreadPriority.AboveNormal; hostServerThread.Start(); hostServerThread.Join(); }
public SimpleHostServer(SnippetDataRepository repository, DomainPool domainPool) { this.repository = repository; this.domainPool = domainPool; }