2012-04-06 4 views

答えて

1

チェックのApache Commonsのネットライブラリから

https://commons.apache.org/net/

そのexample

public static final void timeTCP(String host) throws IOException 
{ 
    TimeTCPClient client = new TimeTCPClient(); 
    try { 
      // We want to timeout if a response takes longer than 60 seconds 
      client.setDefaultTimeout(60000); 
      client.connect(host); 
      System.out.println(client.getDate()); 
    } finally { 
      client.disconnect(); 
    } 
} 
関連する問題