C
C#2mo ago
light

API call hangs on mobile (.NET MAUI)

I have a .NET MAUI application that when deployed on my mobile device takes forever the actually make the API request. I have to restart the app multiple times before the request will actually go through. The API server receives the client connection but no data is ever sent. I have all the correct permissions for the mobile app. Is this a common issue with MAUI or is there an issue with the way I handle my HTTP requests?
2 Replies
becquerel
becquerel2mo ago
nothing in how you're doing the http call stands out to me as bad. the only thing that comes to mind is, even though you're using ihttpclientfactory here, is there any chance you're experiencing socket exhaustion by some other part of your app disposing httpclients? also, does this still happen if you strip your code down to a minimal example? does it happen with different payloads?
light
lightOP2mo ago
yeah I've isolated the method and created a full blank MAUI application. Along with this I ran it with the debugger and without and I think there is an issue with threads maybe. I think it just kinda ends in execution? I'm not really that familiar with threading in this context.
Want results from more Discord servers?
Add your server