コード例 #1
0
ファイル: Connection.cs プロジェクト: Davincier/openpetra
 internal Connection(Server server, Socket socket)
 {
     _server = server;
     _socket = socket;
 }
コード例 #2
0
ファイル: Request.cs プロジェクト: Davincier/openpetra
 public Request(Server server, Host host, Connection connection) : base(String.Empty, String.Empty, null)
 {
     _server = server;
     _host = host;
     _connection = connection;
 }
コード例 #3
0
ファイル: Host.cs プロジェクト: Davincier/openpetra
        /// <summary>
        /// Main method for configuring the host
        /// </summary>
        public void Configure(Server server,
            int port,
            string virtualPath,
            string physicalPath,
            string defaultPage,
            bool allowRemoteConnection,
            bool logPageRequests)
        {
            _server = server;

            _port = port;
            _installPath = null;
            _virtualPath = virtualPath;
            _defaultPage = defaultPage;
            _allowRemoteConnection = allowRemoteConnection;

            _lowerCasedVirtualPath = CultureInfo.InvariantCulture.TextInfo.ToLower(_virtualPath);
            _lowerCasedVirtualPathWithTrailingSlash = virtualPath.EndsWith("/", StringComparison.Ordinal) ? virtualPath : virtualPath + "/";
            _lowerCasedVirtualPathWithTrailingSlash = CultureInfo.InvariantCulture.TextInfo.ToLower(_lowerCasedVirtualPathWithTrailingSlash);
            _physicalPath = physicalPath;
            _physicalClientScriptPath = HttpRuntime.AspClientScriptPhysicalPath + "\\";
            _lowerCasedClientScriptPathWithTrailingSlash = CultureInfo.InvariantCulture.TextInfo.ToLower(HttpRuntime.AspClientScriptVirtualPath + "/");

            if (logPageRequests)
            {
                // Make a log folder beneath the web site's root folder and store our request log there
                _logfilePath = Path.Combine(HttpRuntime.AppDomainAppPath, "httpLog", "HttpRequest.log");

                string logFileFolder = Path.GetDirectoryName(_logfilePath);

                if (!Directory.Exists(logFileFolder))
                {
                    Directory.CreateDirectory(logFileFolder);
                }

                _logfileWriter = new StreamWriter(_logfilePath);
            }
        }