public Pipeline(Application application, ITransaction transaction) { this.application = application; this.transaction = transaction; pending = ApplicationHost.Pipes == null ? 1 : ApplicationHost.Pipes.Count; step = PipelineStep.PreProcess; handle = GCHandle.Alloc(this); transaction.Response.OnEnd += HandleEnd; }
/// <summary> /// Causes the action specified in the constructor to be executed. Infrastructure. /// </summary> /// <param name="app"> /// A <see cref="Application"/> /// </param> public void Run(Application app) { if (stopped) return; try { callback (app, data); } catch (System.Exception e) { Console.Error.WriteLine ("Exception in timeout callback."); Console.Error.WriteLine (e); } repeat.RepeatPerformed (); }
public void HandleTransaction(Application app, ITransaction con) { Pipeline pipeline = new Pipeline(app, con); pipeline.Begin(); }
public virtual void OnPreProcessRequest(Application application, ITransaction transaction, System.Action complete) { complete (); }
public static void Start(Application application) { if (application == null) throw new ArgumentNullException("application"); app = application; app.StartInternal(); foreach (var ep in listenEndPoints) { var server = new Server(Context, HandleTransaction, Context.CreateTcpServerSocket(ep.AddressFamily)); server.Listen(ep.Address.ToString(), ep.Port); servers.Add(server); } foreach (var ep in secureListenEndPoints.Keys) { // var keypair = secureListenEndPoints [ep]; // var socket = Context.CreateSecureSocket (keypair.Item1, keypair.Item2); // var server = new HttpServer (context, HandleTransaction, socket); // server.Listen (ep.Address.ToString (), ep.Port); // // servers.Add (server); } context.Start(); }