public static void Host(this IKayakServer server, OwinApplication application, Action <Action> trampoline) { server.HostInternal(application, trampoline).AsContinuation <object>(trampoline) (_ => { }, e => { Console.WriteLine("Error while hosting application."); Console.Out.WriteException(e); }); }
static IEnumerable <object> HostInternal(this IKayakServer server, OwinApplication application, Action <Action> trampoline) { while (true) { var accept = new ContinuationState <ISocket>((r, e) => server.GetConnection()(r)); yield return(accept); if (accept.Result == null) { break; } accept.Result.ProcessSocket(new HttpSupport(), application, trampoline); } }
public static void Host(this IKayakServer server, OwinApplication application, Action <Action> trampoline) { server.HostInternal(application, trampoline).AsContinuation <object>(trampoline) (_ => { }, e => logger.ErrorException("KayakHost", e)); }
public static void Host(this IKayakServer server, OwinApplication application) { server.Host(application, null); }