Plugin connection problem

Support for Android version of Total Commander

Moderators: white, Hacker, petermad, Stefan2

Post Reply
test01
Junior Member
Junior Member
Posts: 2
Joined: 2012-06-02, 08:26 UTC

Plugin connection problem

Post by *test01 »

Hello.
I have installed FTP, WebDav and Lan plugins and all of them display an error, if I try to konnect somewhere with 3g and WiFi turned off. Even to localhost (I set up a local ftp-server).
With active WiFi or 3g it works normally.
Self-connecting through ftp may be useless, but it refuses to work if internet-connection is shared from PC by usb too. And this feature is not so useless.
So the question is: [how] can this checking of 3g/WiFi connectivity be turned off?
Thanks.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

FTP and WebDAV should work also over other connections than Wifi and phone connections if there are any - I don't know whether you can connect to localhost when there is no Internet at all. You need to allow non-wiFi connections in the settings of the LAN plugin.
it refuses to work if internet-connection is shared from PC by usb too
How do you do that?
Author of Total Commander
https://www.ghisler.com
test01
Junior Member
Junior Member
Posts: 2
Joined: 2012-06-02, 08:26 UTC

Post by *test01 »

allow non-wiFi connections in the settings
Oh, I didn't know plugins have settings. Now webDav and Lan aren't asking for turning on WiFi or 3g but FTP steel does (havn't found any options for it).
How do you do that?
connect phone to PC as usb-modem, correct routes on PC and android and set 8.8.8.8 as DNS (on android).
Opera works correctly with my settings.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Indeed the FTP client needs an internet connection to work. Here is what I use:

Code: Select all

		NetworkInfo ni;
		try { 
			ConnectivityManager cm=(ConnectivityManager)service.getSystemService(Context.CONNECTIVITY_SERVICE);
			ni=cm.getActiveNetworkInfo();
			connected=ni!=null;
			for (int i=0;i<=9;i++)
				if (!connected) {
					ni=cm.getNetworkInfo(i);
					connected=ni!=null && ni.isConnected();
				}
		} catch (Exception e) {
			ni=null;
		}
		if (!connected) {
			errorMsg(s_NoInternet, false);
			return FTP_GETSOCKNAMEFAILED;
		}
Otherwise the call to connect would hang...
Author of Total Commander
https://www.ghisler.com
Post Reply