Back to project page twawm2.
The source code is released under:
Copyright (c) 2014, afnf All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistr...
If you think the Android project twawm2 listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.appspot.afnf4199ga.wmgraph.app; //from w w w. jav a 2 s . c om import com.appspot.afnf4199ga.twawm.router.InetLookupWrappter; import com.appspot.afnf4199ga.utils.Logger; public class InetLookupThread extends Thread { private InetLookupWrappter inetLookupWrappter = new InetLookupWrappter(); public boolean working = true; @Override public void run() { Logger.i("InetLookupThread started"); // ??? try { while (working) { // ???? long tmp = Math.max(3000, MainActivity.interval); Thread.sleep(tmp); // ??????? if (working) { // DNS lookup String host = "www." + (10 + (int) (Math.random() * 10000)) + ".com"; boolean success = inetLookupWrappter.getByName(host) != null; Logger.i("lookuped : " + host + ", " + (success ? "success" : "failure")); } } } catch (Throwable e) { } Logger.i("InetLookupThread finished"); } }