示例#1
0
 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);
     });
 }
示例#2
0
        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);
            }
        }
示例#3
0
 public static void Host(this IKayakServer server, OwinApplication application, Action <Action> trampoline)
 {
     server.HostInternal(application, trampoline).AsContinuation <object>(trampoline)
         (_ => { }, e => logger.ErrorException("KayakHost", e));
 }
示例#4
0
 public static void Host(this IKayakServer server, OwinApplication application)
 {
     server.Host(application, null);
 }