Android Open Source - android_network_discovery Banner From Project Back to project page android_network_discovery .
License The source code is released under:
GNU General Public License
If you think the Android project android_network_discovery listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code /*
* Copyright (C) 2009-2010 Aubort Jean-Baptiste (Rorist)
* Licensed under GNU's GPL 2, see README
*/ / / w w w . j a v a 2 s . c o m
package info.lamatricexiste.network.Network;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.InetSocketAddress;
import java.net.Socket;
import android.os.AsyncTask;
import android.util.Log;
public class Banner extends AsyncTask<Void, String, Void> {
private final String TAG = "Banner" ;
private static final int BUF = 8 * 1024;
private String host;
private int port;
private int timeout;
private String banner = "" ;
public Banner(String host, int port, int timeout) {
this.host = host;
this.port = port;
this.timeout = timeout;
}
@Override
protected Void doInBackground(Void... params) {
try {
Socket s = new Socket();
s.bind(null);
s.connect(new InetSocketAddress(host, port), timeout);
BufferedReader in = new BufferedReader(new InputStreamReader(s.getInputStream()), BUF);
while ((banner = in.readLine()) != null) {
break ;
}
in.close();
s.close();
Log.v(TAG, banner);
return null;
} catch (IOException e) {
}
return null;
}
}
Java Source Code List info.lamatricexiste.network.AbstractDiscovery.java info.lamatricexiste.network.ActivityDiscovery.java info.lamatricexiste.network.ActivityMain.java info.lamatricexiste.network.ActivityNet.java info.lamatricexiste.network.ActivityPortscan.java info.lamatricexiste.network.AsyncPortscan.java info.lamatricexiste.network.DatabaseHelper.java info.lamatricexiste.network.DefaultDiscovery.java info.lamatricexiste.network.DiscoverActivity.java info.lamatricexiste.network.DnsDiscovery.java info.lamatricexiste.network.NetworkChange.java info.lamatricexiste.network.Network.Banner.java info.lamatricexiste.network.Network.DownloadFile.java info.lamatricexiste.network.Network.HardwareAddress.java info.lamatricexiste.network.Network.HostBean.java info.lamatricexiste.network.Network.NetInfo.java info.lamatricexiste.network.Network.OsFingerprint.java info.lamatricexiste.network.Network.Ping.java info.lamatricexiste.network.Network.RateControl.java info.lamatricexiste.network.Network.SendSmbNegotiate.java info.lamatricexiste.network.Utils.DbUpdate.java info.lamatricexiste.network.Utils.Db.java info.lamatricexiste.network.Utils.Export.java info.lamatricexiste.network.Utils.Help.java info.lamatricexiste.network.Utils.Prefs.java info.lamatricexiste.network.Utils.Save.java info.lamatricexiste.network.Utils.UpdateNicDb.java info.lamatricexiste.network.connectivity.java info.lamatricexiste.network.portscan.java info.lamatricexiste.network.wifiinfo.java