下面是我的代码。当我运行此代码时,它总是卡住。有时它会运行循环 100 次,有时会运行 3000 次。奇怪的是它不会抛出错误,而是会卡住。有人有什么想法吗?
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import us.monoid.web.Resty;
public class Example1 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// Allow certificates - See http://en.wikibooks.org/wiki/Programming:WebObjects/Web_Services/How_to_Trust_Any_SSL_Certificate
SSLUtilities.trustAllHostnames( );
SSLUtilities.trustAllHttpsCertificates() ;
// Variables
int i = 0;
String askBidURL = "https://www.exchangebitcoins.com/data/depth";
while(true){
System.out.println("Example 1 - Run #" + i);
Resty r = new Resty();
try {String jsonw = r.text(askBidURL).toString();}
catch (IOException ex){Logger.getLogger(Example1.class.getName()).log(Level.SEVERE, null, ex); }
i++;
}
}
}