コード例 #1
0
ファイル: ContextBase.cs プロジェクト: drazenzadravec/nequeo
        /// <summary>
        /// Create the web context.
        /// </summary>
        /// <param name="context">The current provider context.</param>
        /// <returns>The web context.</returns>
        protected WebContext CreateWebContext(Nequeo.Net.Provider.Context context)
        {
            // If the context has not been created.
            if (context.ContextState == null)
            {
                // Create the new context.
                Nequeo.Net.WebContext webContext = new Nequeo.Net.WebContext(context);

                // Assign the current context.
                webContext.IsSecureConnection = context.IsSecureConnection;
                webContext.IsSslAuthenticated = context.IsSslAuthenticated;
                webContext.RemoteEndPoint     = context.RemoteEndPoint;
                webContext.ServerEndPoint     = context.ServerEndPoint;
                webContext.Port                = context.Port;
                webContext.Name                = context.Name;
                webContext.ServiceName         = context.ServiceName;
                webContext.NumberOfClients     = context.NumberOfClients;
                webContext.UniqueIdentifier    = context.UniqueIdentifier;
                webContext.SocketState         = context.SocketState;
                webContext.IsAsyncMode         = context.IsAsyncMode;
                webContext.ConnectionID        = context.ConnectionID;
                webContext.SessionID           = context.SessionID;
                webContext.IsAuthenticated     = false;
                webContext.IsStartOfConnection = true;

                // Create the response and request objects.
                webContext.WebResponse = Nequeo.Net.WebResponse.Create(context.Response.Output);
                webContext.WebRequest  = Nequeo.Net.WebRequest.Create(context.Request.Input);

                // Assign the current context.
                context.ContextState = webContext;
            }
            else
            {
                // Get the current context.
                Nequeo.Net.WebContext webContext = (Nequeo.Net.WebContext)context.ContextState;
                webContext.UniqueIdentifier    = context.UniqueIdentifier;
                webContext.IsStartOfConnection = false;

                // Assign the current context.
                context.ContextState = webContext;
            }

            // Return the request context.
            return((Nequeo.Net.WebContext)context.ContextState);
        }
コード例 #2
0
ファイル: ContextBase.cs プロジェクト: drazenzadravec/nequeo
 /// <summary>
 /// On web context received.
 /// </summary>
 /// <param name="context">The web context.</param>
 protected abstract void OnWebContext(WebContext context);
コード例 #3
0
ファイル: WebContext.cs プロジェクト: drazenzadravec/nequeo
 /// <summary>
 /// Web server context app domain host.
 /// </summary>
 /// <param name="context">The web context.</param>
 public WebContextHost(WebContext context)
 {
     _context = context;
 }