diff --git a/Esiur.ASPNet/MyResource.cs b/Esiur.ASPNet/MyResource.cs index 1fb03eb..3f23c5a 100644 --- a/Esiur.ASPNet/MyResource.cs +++ b/Esiur.ASPNet/MyResource.cs @@ -1,4 +1,30 @@ -using Esiur.Resource; +/* + +MIT License + +Copyright (c) 2024 Esiur Foundation, Ahmed Kh. Zamil. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +*/ + +using Esiur.Resource; namespace Esiur.AspNetCore.Example { diff --git a/Esiur.ASPNet/Program.cs b/Esiur.ASPNet/Program.cs index efa89bc..afd627f 100644 --- a/Esiur.ASPNet/Program.cs +++ b/Esiur.ASPNet/Program.cs @@ -1,3 +1,29 @@ +/* + +MIT License + +Copyright (c) 2024 Esiur Foundation, Ahmed Kh. Zamil. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +*/ + using Esiur.AspNetCore; using Esiur.AspNetCore.Example; using Esiur.Core; @@ -31,20 +57,6 @@ var webSocketOptions = new WebSocketOptions() app.UseWebSockets(webSocketOptions); -//// Configure the HTTP request pipeline. -//if (app.Environment.IsDevelopment()) -//{ -// app.UseSwagger(); -// app.UseSwaggerUI(); -//} - -//app.UseHttpsRedirection(); - -//app.UseAuthorization(); - -//app.MapControllers(); - - await Warehouse.Put("sys", new MemoryStore()); await Warehouse.Put("sys/service", new MyResource()); var server = await Warehouse.Put("sys/server", new DistributedServer()); diff --git a/Esiur.AspNetCore/EsiurMiddleware.cs b/Esiur.AspNetCore/EsiurMiddleware.cs index 7bbbc8a..010b733 100644 --- a/Esiur.AspNetCore/EsiurMiddleware.cs +++ b/Esiur.AspNetCore/EsiurMiddleware.cs @@ -1,4 +1,29 @@ - +/* + +MIT License + +Copyright (c) 2017-2024 Esiur Foundation, Ahmed Kh. Zamil. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +*/ + using Esiur.Net.IIP; using Esiur.Net.Sockets; using Microsoft.AspNetCore.Http; diff --git a/Esiur.AspNetCore/EsiurMiddlewareExtensions.cs b/Esiur.AspNetCore/EsiurMiddlewareExtensions.cs index 3d1ec8e..2980149 100644 --- a/Esiur.AspNetCore/EsiurMiddlewareExtensions.cs +++ b/Esiur.AspNetCore/EsiurMiddlewareExtensions.cs @@ -1,4 +1,30 @@ -using Microsoft.AspNetCore.Builder; +/* + +MIT License + +Copyright (c) 2017-2024 Esiur Foundation, Ahmed Kh. Zamil. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +*/ + +using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.Options; namespace Esiur.AspNetCore diff --git a/Esiur.AspNetCore/EsiurOptions.cs b/Esiur.AspNetCore/EsiurOptions.cs index d067dfb..65f001e 100644 --- a/Esiur.AspNetCore/EsiurOptions.cs +++ b/Esiur.AspNetCore/EsiurOptions.cs @@ -1,4 +1,30 @@ -using Esiur.Net.IIP; +/* + +MIT License + +Copyright (c) 2017-2024 Esiur Foundation, Ahmed Kh. Zamil. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +*/ + +using Esiur.Net.IIP; namespace Esiur.AspNetCore { diff --git a/Esiur.CLI/GetTemplateOptions.cs b/Esiur.CLI/GetTemplateOptions.cs index d1d5e90..1511149 100644 --- a/Esiur.CLI/GetTemplateOptions.cs +++ b/Esiur.CLI/GetTemplateOptions.cs @@ -1,4 +1,30 @@ -using CommandLine; +/* + +MIT License + +Copyright (c) 2024 Esiur Foundation, Ahmed Kh. Zamil. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +*/ + +using CommandLine; using System; using System.Collections.Generic; using System.Linq; diff --git a/Esiur.CLI/Program.cs b/Esiur.CLI/Program.cs index 89e90f1..b4eeab6 100644 --- a/Esiur.CLI/Program.cs +++ b/Esiur.CLI/Program.cs @@ -1,4 +1,30 @@  +/* + +MIT License + +Copyright (c) 2024 Esiur Foundation, Ahmed Kh. Zamil. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +*/ + using CommandLine; using Esiur.CLI; using Esiur.Data; diff --git a/Esiur/Net/Sockets/FrameworkWebSocket.cs b/Esiur/Net/Sockets/FrameworkWebSocket.cs index 7c17dd8..d43c990 100644 --- a/Esiur/Net/Sockets/FrameworkWebSocket.cs +++ b/Esiur/Net/Sockets/FrameworkWebSocket.cs @@ -227,7 +227,7 @@ namespace Esiur.Net.Sockets private void NetworkReceive(Task task) { - if (sock.State == WebSocketState.Closed || sock.State == WebSocketState.Aborted) + if (sock.State == WebSocketState.Closed || sock.State == WebSocketState.Aborted || sock.State == WebSocketState.CloseReceived) { Receiver?.NetworkClose(this); return;