2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-05-06 03:32:57 +00:00
This commit is contained in:
Ahmed Zamil 2024-10-12 13:36:56 +03:00
parent 264c1e1cd8
commit b57352b013
6 changed files with 132 additions and 104 deletions

View File

@ -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());

View File

@ -1,9 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>Esiur distributed resource framework support for ASP.Net</Description>
<Copyright>Ahmed Kh. Zamil</Copyright>
<PackageProjectUrl>http://www.esiur.com</PackageProjectUrl>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>1.0.0</Version>
<Authors>Ahmed Kh. Zamil</Authors>
<Company>Esiur Foundation</Company>
<PackageLicenseUrl>https://github.com/Esiur/Esiur-dotnet/blob/master/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>http://www.esiur.com</PackageProjectUrl>
<RepositoryUrl>https://github.com/esiur/esiur-dotnet/</RepositoryUrl>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Title>Esiur ASP.Net Middleware</Title>
</PropertyGroup>
<ItemGroup>

View File

@ -18,7 +18,8 @@ namespace Esiur.AspNetCore
{
var buffer = new ArraySegment<byte>(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
{

View File

@ -1,6 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>Esiur command-line tool</Description>
<Copyright>Ahmed Kh. Zamil</Copyright>
<PackageProjectUrl>http://www.esiur.com</PackageProjectUrl>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>1.0.0</Version>
<Authors>Ahmed Kh. Zamil</Authors>
<Company>Esiur Foundation</Company>
<PackageLicenseUrl>https://github.com/Esiur/Esiur-dotnet/blob/master/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>http://www.esiur.com</PackageProjectUrl>
<RepositoryUrl>https://github.com/esiur/esiur-dotnet/</RepositoryUrl>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>

View File

@ -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"
}
}
}

View File

@ -63,7 +63,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.11.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.10.0" />
<PackageReference Include="System.Collections" Version="4.3.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Diagnostics.StackTrace" Version="4.3.0" />
@ -77,8 +77,8 @@
<PackageReference Include="System.Text.Json" Version="8.0.5" GeneratePathProperty="true" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.10.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" PrivateAssets="all" />
</ItemGroup>