public void Configure(Server server, int port, String virtualPath, String physicalPath, String installPath, IHttpWorkerRequestHandler handler) { _server = server; requestHandler = handler; _port = port; _virtualPath = virtualPath; _lowerCasedVirtualPath = CultureInfo.InvariantCulture.TextInfo.ToLower(_virtualPath); _lowerCasedVirtualPathWithTrailingSlash = virtualPath.EndsWith("/") ? virtualPath : virtualPath + "/"; _lowerCasedVirtualPathWithTrailingSlash = CultureInfo.InvariantCulture.TextInfo.ToLower(_lowerCasedVirtualPathWithTrailingSlash); _physicalPath = physicalPath; _installPath = installPath; _physicalClientScriptPath = installPath + "\\asp.netclientfiles\\"; String version4 = FileVersionInfo.GetVersionInfo(typeof(HttpRuntime).Module.FullyQualifiedName).FileVersion; String version3 = version4.Substring(0, version4.LastIndexOf('.')); _lowerCasedClientScriptPathWithTrailingSlashV10 = "/aspnet_client/system_web/" + version4.Replace('.', '_') + "/"; _lowerCasedClientScriptPathWithTrailingSlashV11 = "/aspnet_client/system_web/" + version3.Replace('.', '_') + "/"; _onSocketAccept = new WaitCallback(OnSocketAccept); _onStart = new WaitCallback(OnStart); // start watching for app domain unloading _onAppDomainUnload = new EventHandler(OnAppDomainUnload); Thread.GetDomain().DomainUnload += _onAppDomainUnload; }
public Server(int port, String virtualPath, String physicalPath, IHttpWorkerRequestHandler handler) { _port = port; _virtualPath = virtualPath; _physicalPath = physicalPath.EndsWith("\\") ? physicalPath : physicalPath + "\\"; _handler = handler; _restartCallback = new WaitCallback(RestartCallback); _installPath = GetInstallPathAndConfigureAspNetIfNeeded(); CreateHost(); }