Increasing the maximum number of TCP/IP connections in Linux

Maximum number of connections are impacted by certain limits on both client & server sides, albeit a little differently. On the client side: Increase the ephermal port range, and decrease the tcp_fin_timeout To find out the default values: sysctl net.ipv4.ip_local_port_range sysctl net.ipv4.tcp_fin_timeout The ephermal port range defines the maximum number of outbound sockets a host … Read more

How can one check to see if a remote file exists using PHP?

You can instruct curl to use the HTTP HEAD method via CURLOPT_NOBODY. More or less $ch = curl_init(“http://www.example.com/favicon.ico”); curl_setopt($ch, CURLOPT_NOBODY, true); curl_exec($ch); $retcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); // $retcode >= 400 -> not found, $retcode = 200, found. curl_close($ch); Anyway, you only save the cost of the HTTP transfer, not the TCP connection establishment and closing. … Read more

Comparison of Android networking libraries: OkHTTP, Retrofit, and Volley [closed]

I’m hoping someone can provide some concrete examples of best use cases for each. Use Retrofit if you are communicating with a Web service. Use the peer library Picasso if you are downloading images. Use OkHTTP if you need to do HTTP operations that lie outside of Retrofit/Picasso. Volley roughly competes with Retrofit + Picasso. … Read more

Android check internet connection [duplicate]

This method checks whether mobile is connected to internet and returns true if connected: private boolean isNetworkConnected() { ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); return cm.getActiveNetworkInfo() != null && cm.getActiveNetworkInfo().isConnected(); } in manifest, <uses-permission android:name=”android.permission.ACCESS_WIFI_STATE” /> <uses-permission android:name=”android.permission.ACCESS_NETWORK_STATE” /> Edit: This method actually checks if device is connected to internet(There is a possibility it’s connected to … Read more