public static Action <IApplicationBuilder> SocketWsHandler(MessageControllerResolver resolver) { return((Action <IApplicationBuilder>)(app => { app.Run(FunctionWrappersExtensions.AsWsEndpoint(async(context, webSocket) => { await webSocket.CloseAsync(WebSocketCloseStatus.NormalClosure, "result.CloseStatusDescription", CancellationToken.None); })); })); }
public static Action <IApplicationBuilder> SyncHandler(MessageControllerResolver resolver) { return((Action <IApplicationBuilder>)(app => { app.Run(FunctionWrappersExtensions.AsHttpEndpoint(async context => { await context.Response.WriteBodyAsStringAsync(resolver.AcceptSerializedBulk(await context.Request.ReadBodyAsStringAsync()), "application/json"); })); })); }
public static Action <IApplicationBuilder> SocketHandler(MessageControllerResolver resolver) { return((Action <IApplicationBuilder>)(app => { app.Run(FunctionWrappersExtensions.AsHttpEndpoint(async context => { //resolver.Accept() await context.Response.WriteAsync("Socket"); })); })); }