示例#1
0
        protected virtual void OnApplicationConnected(HmeApplicationConnectedEventArgs args)
        {
            EventHandler <HmeApplicationConnectedEventArgs> handler = ApplicationConnected;

            if (handler != null)
            {
                handler(this, args);
            }
        }
示例#2
0
        protected virtual void OnHmeApplicationRequestReceived(HttpListenerContext context)
        {
            ServerLog.Write(TraceEventType.Verbose, "Enter HmeServer.OnHmeApplicationRequestReceived");
            HmeApplicationHttpResponse.BeginResponse(context);
            HmeConnection connection = new HmeConnection(context.Request.InputStream, context.Response.OutputStream);
            HmeApplicationConnectedEventArgs args = new HmeApplicationConnectedEventArgs();

            args.Application = connection.Application;
            args.BaseUri     = BuildBaseUri(context);

            OnApplicationConnected(args);
            _pump.AddHmeConnection(connection);
            ServerLog.Write(TraceEventType.Verbose, "Exit HmeServer.OnHmeApplicationRequestReceived");
        }
示例#3
0
        protected override void OnApplicationConnected(HmeApplicationConnectedEventArgs args)
        {
            ApplicationT applicationT = new ApplicationT();

            // store copy associated to application so it can be used in closed event
            _applications.Add(args.Application, applicationT);
            args.Application.Closed += new EventHandler <EventArgs>(Application_Closed);
            // set the base uri for the application
            applicationT.BaseUri = args.BaseUri;
            // start the application
            HmeApplicationStartArgs startArgs = new HmeApplicationStartArgs();

            startArgs.Application  = args.Application;
            startArgs.HostServices = this;
            applicationT.OnApplicationStart(startArgs);

            base.OnApplicationConnected(args);
        }