check internet connection in cocoa application

The current version of Reachability code (2.2) listed on Apple’s site and referenced above does NOT compile as-is for a Mac OS X Cocoa application. The constant kSCNetworkReachabilityFlagsIsWWAN is only available when compiling for TARGET_OS_IPHONE and Reachability.m references that constant. You will need to #ifdef the two locations in Reachability.m that reference it like below: … Read more

How to check the Internet connection with .NET, C#, and WPF

Many developers are solving that “problem” just by ping-ing Google.com. Well…? :/ That will work in most (99%) cases, but how professional is to rely work of Your application on some external web service? Instead of pinging Google.com, there is an very interesting Windows API function called InternetGetConnectedState(), that recognizes whether You have access to … Read more

MySQL Error “Too many connections”

Shared-hosting providers generally allow a pretty small amount of simultaneous connections for the same user. What your code does is : open a connection to the MySQL server do it’s stuff (generating the page) close the connection at the end of the page. The last step, when done at the end of the page is … Read more

How to fix HttpException: Connection closed before full header was received

Right now this issue is opened on github https://github.com/flutter/flutter/issues/32587 Temporarily you can solve this issue by switching to physical device instead of emulator How to test android apps in a real device with Android Studio? Decision found on github (link upward) I’ve got a temporary work around, which I can use for now. The exception … Read more

Bad state: Insecure HTTP is not allowed by platform: [closed]

For Android: This behavior may be omitted following migration guide: https://flutter.dev/docs/release/breaking-changes/network-policy-ios-android. or… Just add in android/app/src/main/AndroidManifest.xml: android:usesCleartextTraffic=”true” to <application /> also dont forget to take INTERNET PERMISSION: <uses-permission android:name=”android.permission.INTERNET” /> <!– This Line –> <application android:name=”io.flutter.app.FlutterApplication” android:label=”receipt” android:usesCleartextTraffic=”true” <!– This Line –> android:icon=”@mipmap/ic_launcher”> For iOS: Allow insecure/HTTP requests globally across your application on iOS, you … Read more

Why would a “java.net.ConnectException: Connection timed out” exception occur when URL is up?

Connection timeouts (assuming a local network and several client machines) typically result from a) some kind of firewall on the way that simply eats the packets without telling the sender things like “No Route to host” b) packet loss due to wrong network configuration or line overload c) too many requests overloading the server d) … Read more