Share via

Connection Refused Error in NetMaui Application or its API

Yusuf 791 Reputation points
2023-01-13T08:57:03.2233333+00:00

Hello,

I have a Net Maui application and its API

The application/API works, but when sending many requests to the server, this exception occurs:

Connection refused.

The API cannot be accessed from the phone browser, but it can be done from the desktop browser

The exception occurs intermittently

The application

https://github.com/devenv2/TestapiMauiApp1

API

https://github.com/devenv2/WebSite2

Phone OS

android 7.1.1

SSL

let's encrypt

Thanks in advance

Developer technologies | .NET | .NET MAUI
Developer technologies | C#
Developer technologies | C#

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.


1 answer

Sort by: Most helpful
  1. Johan Smarius 470 Reputation points MVP
    2024-03-04T07:29:55.27+00:00

    Based on your question, I think there is a problem with throttling/rate limiting with the API. Many shared hosting options protect the hosted API's against too many requests to prevent a DDOS attack and server overload. If you perform only a few requests (after a wait period), the server will probably work correctly. Check the HTTP status code. If it is 429 then you have reached the rate limit set for GitHub Pages (https://docs.github.com/en/pages/getting-started-with-github-pages/about-github-pages#limits-on-use-of-github-pages). If you need more concurrent requests than the rate limit allows, I would suggest moving to Azure.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.