embedio icon indicating copy to clipboard operation
embedio copied to clipboard

Crash the webserver and restart the main application

Open gangwar1 opened this issue 1 year ago • 2 comments

Describe the bug I have an maui application with target framework .net 8 android. In this application I am using a this embedio webserver in a separate thread with one controller as per document. Now in that api's we doing some operations in thiose operations some are log running so we agin doing those operations in new thread meanwhile we returned the 200 response for that api. If we have some exceptions in long running task it raise crash the server even we have try catch handling in that thread . Due to this my main maui application is restart by automatically and when we try to access the server it will not access. Even we try to run again it give socket exceptions permission denied.

Smartphone (please complete the following information):

  • Device: phone and tablet both
  • OS: android
  • Version 10+

gangwar1 avatar Aug 01 '24 19:08 gangwar1

We have the same problem. The server is stopped when the screen rotation changes or if the app gets suspended and then resumed.

We are waiting for the new hosted ASP.NET solution here

https://github.com/dotnet/aspnetcore/issues/35077#issuecomment-2525347447

I wonder how wisej.NET solved this problem. since they also use embedio.

dos-ise avatar Dec 17 '24 09:12 dos-ise

Seeing in other comments it is not EmbedIO but Kestrel, try switching the server mode from HttpListenerMode.Microsoft to HttpListenerMode.EmbedIO. It has solved me the problem of after a request server is failing since the EmbedIO has its own implementation

Use EmbedIO's internal HTTP listener implementation, based on Mono's System.Net.HttpListener

JoaquinC539 avatar Nov 13 '25 21:11 JoaquinC539