From b57352b0133cb0072d4e74229cc1f03ea8d58458 Mon Sep 17 00:00:00 2001 From: Ahmed Zamil Date: Sat, 12 Oct 2024 13:36:56 +0300 Subject: [PATCH] await --- Esiur.ASPNet/Program.cs | 18 +-- Esiur.AspNetCore/Esiur.AspNetCore.csproj | 15 +- Esiur.AspNetCore/EsiurMiddleware.cs | 7 +- Esiur.CLI/Esiur.CLI.csproj | 14 +- Esiur.CLI/Properties/launchSettings.json | 2 +- Esiur/Esiur.csproj | 180 +++++++++++------------ 6 files changed, 132 insertions(+), 104 deletions(-) diff --git a/Esiur.ASPNet/Program.cs b/Esiur.ASPNet/Program.cs index 8b3f0e3..efa89bc 100644 --- a/Esiur.ASPNet/Program.cs +++ b/Esiur.ASPNet/Program.cs @@ -31,18 +31,18 @@ var webSocketOptions = new WebSocketOptions() app.UseWebSockets(webSocketOptions); -// Configure the HTTP request pipeline. -if (app.Environment.IsDevelopment()) -{ - app.UseSwagger(); - app.UseSwaggerUI(); -} +//// Configure the HTTP request pipeline. +//if (app.Environment.IsDevelopment()) +//{ +// app.UseSwagger(); +// app.UseSwaggerUI(); +//} -app.UseHttpsRedirection(); +//app.UseHttpsRedirection(); -app.UseAuthorization(); +//app.UseAuthorization(); -app.MapControllers(); +//app.MapControllers(); await Warehouse.Put("sys", new MemoryStore()); diff --git a/Esiur.AspNetCore/Esiur.AspNetCore.csproj b/Esiur.AspNetCore/Esiur.AspNetCore.csproj index a235bcb..b796dd9 100644 --- a/Esiur.AspNetCore/Esiur.AspNetCore.csproj +++ b/Esiur.AspNetCore/Esiur.AspNetCore.csproj @@ -1,9 +1,22 @@  - net8.0 + Esiur distributed resource framework support for ASP.Net + Ahmed Kh. Zamil + http://www.esiur.com + true + 1.0.0 + Ahmed Kh. Zamil + Esiur Foundation + + https://github.com/Esiur/Esiur-dotnet/blob/master/LICENSE + http://www.esiur.com + https://github.com/esiur/esiur-dotnet/ + + net8.0 enable enable + Esiur ASP.Net Middleware diff --git a/Esiur.AspNetCore/EsiurMiddleware.cs b/Esiur.AspNetCore/EsiurMiddleware.cs index f2f2c26..7bbbc8a 100644 --- a/Esiur.AspNetCore/EsiurMiddleware.cs +++ b/Esiur.AspNetCore/EsiurMiddleware.cs @@ -18,7 +18,8 @@ namespace Esiur.AspNetCore { var buffer = new ArraySegment(new byte[10240]); - if (context.WebSockets.IsWebSocketRequest) + if (context.WebSockets.IsWebSocketRequest + && context.WebSockets.WebSocketRequestedProtocols.Contains("iip")) { var webSocket = await context.WebSockets.AcceptWebSocketAsync("iip"); var socket = new FrameworkWebSocket(webSocket); @@ -27,7 +28,9 @@ namespace Esiur.AspNetCore iipConnection.Assign(socket); socket.Begin(); - while (webSocket.State == WebSocketState.Open) ; + // @TODO: Change this + while (webSocket.State == WebSocketState.Open) + await Task.Delay(500); } else { diff --git a/Esiur.CLI/Esiur.CLI.csproj b/Esiur.CLI/Esiur.CLI.csproj index 83034a7..9d0566c 100644 --- a/Esiur.CLI/Esiur.CLI.csproj +++ b/Esiur.CLI/Esiur.CLI.csproj @@ -1,7 +1,19 @@  - Exe + Esiur command-line tool + Ahmed Kh. Zamil + http://www.esiur.com + true + 1.0.0 + Ahmed Kh. Zamil + Esiur Foundation + + https://github.com/Esiur/Esiur-dotnet/blob/master/LICENSE + http://www.esiur.com + https://github.com/esiur/esiur-dotnet/ + + Exe net8.0 enable enable diff --git a/Esiur.CLI/Properties/launchSettings.json b/Esiur.CLI/Properties/launchSettings.json index 983a993..3de5e59 100644 --- a/Esiur.CLI/Properties/launchSettings.json +++ b/Esiur.CLI/Properties/launchSettings.json @@ -2,7 +2,7 @@ "profiles": { "Esiur.CLI": { "commandName": "Project", - "commandLineArgs": "get-template iip://phase.delta.iq/sys/phase -d c:\\temp\\a" + "commandLineArgs": "get-template iip://phase.delta.iq/sys/phase --dir c:\\temp\\an" } } } \ No newline at end of file diff --git a/Esiur/Esiur.csproj b/Esiur/Esiur.csproj index 72ef6af..10fa76c 100644 --- a/Esiur/Esiur.csproj +++ b/Esiur/Esiur.csproj @@ -1,112 +1,112 @@  - - Distributed Resources Platform - Ahmed Kh. Zamil - http://www.esiur.com - true - 2.4.5 - https://github.com/esiur/esiur-dotnet - Ahmed Kh. Zamil - - Esiur Foundation - - Esiur - Esiur - Esiur - Esiur - latest - LICENSE - netstandard2.0 - + + Distributed Resources Platform + Ahmed Kh. Zamil + http://www.esiur.com + true + 2.4.5 + https://github.com/esiur/esiur-dotnet + Ahmed Kh. Zamil + + Esiur Foundation + + Esiur + Esiur + Esiur + Esiur + latest + LICENSE + netstandard2.0 + - - True - TRACE;DEBUG;NETSTANDARD - + + True + TRACE;DEBUG;NETSTANDARD + - - True - + + True + - - - - - + + + + + - - - - - - - - - + + + + + + + + + - + - - - - + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - + + - + - - - - - - + + + + + + - - - + + + - - - - + + + + - - - - + + + + - - \ No newline at end of file + +