Forum
    • Categories
    • Register
    • Login

    [feature request] Network connectivity checker

    Scheduled Pinned Locked Moved Feature Requests
    7 Posts 2 Posters 503 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • David HealeyD
      David Healey
      last edited by David Healey

      Currently we can use Server.isOnline() to see if there is an internet connection. This works by pinging google's server and seeing if it gets a result. It's a basic solution to the problem but not ideal. For example I've had users in China behind the great firewall who are able to connect to my server but not Google's. I've also had other users who have a slow connection and have to wait quite a while for the check to return, and in the meantime it looks like my plugin's just hanging or frozen.

      A better solution is to ask the OS if there is currently an active network connection.

      After googling the problem it seems another JUCE user has already come up with a way to do it.

      @Christoph-Hart If you think this is good and when you have time, could you implement it, and perhaps add a broadcaster too?

      https://gitlab.com/squarepine/squarepinemodules/-/tree/c5d0d60f20c41931c770a25b0a6d4f57878a04fa/modules/squarepine_core/networking

      Additionally this also tells us the type of connection the system is using. This is nice because we can give the user the option of only downloading large files when not using mobile data for example.

      Free HISE Bootcamp Full Course for beginners.
      YouTube Channel - Public HISE tutorials
      My Patreon - HISE tutorials

      1 Reply Last reply Reply Quote 5
      • David HealeyD
        David Healey
        last edited by

        Claude implementation: https://github.com/christophhart/HISE/pull/953

        Tested on Linux so far.

        Free HISE Bootcamp Full Course for beginners.
        YouTube Channel - Public HISE tutorials
        My Patreon - HISE tutorials

        ustkU 1 Reply Last reply Reply Quote 1
        • ustkU
          ustk @David Healey
          last edited by ustk

          @David-Healey Hey Dave! I currently have a user enable to get the online mode on my license manager...

          So I'm checking this solution but it seems I couldn't build for some reasons (macOS)

          Claude helped:

          What was wrong: NetworkConnectivityCheckerApple.cpp􀰓 includes <SystemConfiguration/SystemConfiguration.h>, which transitively pulls in MacTypes.h. That Carbon-era header defines a global Point struct, which is ambiguous against juce::Point (brought into scope by the using namespace juce; directive in the unity translation unit).

          Fix: Wrap the SystemConfiguration include with #define Point DummyPoint (plus Component and MemoryBlock) and matching #undefs, mirroring the existing trick at hi_tools_01.cpp:36-44 for Accelerate.h. Edit at hi_tools/hi_tools/NetworkConnectivityCheckerApple.cpp:12-26.

          It seems to work in Hise, I will check the exported binary today

          Hise made me an F5 dude, any other app just suffers...

          David HealeyD 1 Reply Last reply Reply Quote 0
          • David HealeyD
            David Healey @ustk
            last edited by

            @ustk I haven't tried building with it I don't think. I made the PR but haven't used it. For complicated things like this I don't trust the AI enough so I wait for Christoph to merge it.

            Free HISE Bootcamp Full Course for beginners.
            YouTube Channel - Public HISE tutorials
            My Patreon - HISE tutorials

            ustkU 1 Reply Last reply Reply Quote 0
            • ustkU
              ustk @David Healey
              last edited by

              @David-Healey that's a good point

              But since I am having troubles anyway, I am currently releasing a new system so I'll use it and see. Since isOnline doesn't work for some people, I need a solution for them...

              Do you happen to understand the issue behind isOnline?
              Because I wonder if I shouldn't directly check if my own server is avail instead of google. in the end this is the only thing I need.
              But perhaps the issue has a common ground no matter which website you check... And since I can't reproduce it...

              Hise made me an F5 dude, any other app just suffers...

              David HealeyD 1 Reply Last reply Reply Quote 0
              • David HealeyD
                David Healey @ustk
                last edited by

                @ustk said in [feature request] Network connectivity checker:

                Do you happen to understand the issue behind isOnline?

                isOnline pings Google's server. On a slow connection this can time out. If the user is behind a firewall or in a country like China the request can be blocked entirely and just hang until it times out.

                Free HISE Bootcamp Full Course for beginners.
                YouTube Channel - Public HISE tutorials
                My Patreon - HISE tutorials

                ustkU 1 Reply Last reply Reply Quote 0
                • ustkU
                  ustk @David Healey
                  last edited by

                  @David-Healey so there's no way my server could be faster, especially since it is actually very slow...

                  Hise made me an F5 dude, any other app just suffers...

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post

                  18

                  Online

                  2.4k

                  Users

                  13.7k

                  Topics

                  119.4k

                  Posts