{"id":475,"date":"2013-07-07T13:42:01","date_gmt":"2013-07-07T05:42:01","guid":{"rendered":"http:\/\/blog.staryland.com\/?p=475"},"modified":"2013-07-07T13:42:01","modified_gmt":"2013-07-07T05:42:01","slug":"%e5%88%a9%e7%94%a8java%e8%8e%b7%e5%8f%96%e7%bd%91%e7%bb%9c%e6%a0%87%e5%87%86%e6%97%b6%e9%97%b4","status":"publish","type":"post","link":"https:\/\/zhuangzr.me\/wordpress\/2013\/07\/%e5%88%a9%e7%94%a8java%e8%8e%b7%e5%8f%96%e7%bd%91%e7%bb%9c%e6%a0%87%e5%87%86%e6%97%b6%e9%97%b4\/","title":{"rendered":"\u5229\u7528Java\u83b7\u53d6\u7f51\u7edc\u6807\u51c6\u65f6\u95f4"},"content":{"rendered":"<pre class=\"brush: java; title: ; notranslate\" title=\"\">import java.net.*;\nimport java.io.*;\npublic class DaytimeClient\n{\n\t\/**\n\t * @param args\n\t *\/\n\tpublic static void main(String&#x5B;] args)\n\t{\n\t\t\/\/ TODO Auto-generated method stub\n\t\tString&#x5B;] hostname = new String&#x5B;]{&quot;&quot;, &quot;time.windows.com&quot;,&quot;time.nist.gov&quot;,&quot;time-nw.nist.gov&quot;,&quot;time-a.nist.gov&quot;,&quot;time-b.nist.gov&quot;};\n\t\tint i = 1;\n\t\tboolean RecvFlag = false;\n\t\tif(args.length &amp;gt; 0)\n\t\t{\n\t\t\thostname&#x5B;0] = args&#x5B;0];\n\t\t\ti = 0;\n\t\t}\n\t\twhile(i &amp;lt;=5 &amp;amp;&amp;amp; !RecvFlag)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tSocket timeSocket = new Socket(hostname&#x5B;i], 13);\n\t\t\t\tInputStream timeStream = timeSocket.getInputStream();\n\t\t\t\tStringBuffer time = new StringBuffer();\n\t\t\t\tint c;\n\t\t\t\twhile((c=timeStream.read()) != -1)\n\t\t\t\t\ttime.append((char)c);\n\t\t\t\tString timeString = time.toString().trim();\n\t\t\t\tSystem.out.println(&quot;It is &quot; + timeString +&quot; at &quot; + hostname&#x5B;i] +&quot; on port &quot; + timeSocket.getPort());\n\t\t\t\tRecvFlag = true;\n\t\t\t\ttimeSocket.close();\n\t\t\t}\n\t\t\tcatch(UnknownHostException e)\n\t\t\t{\n\t\t\t\tSystem.out.println(&quot;Failed to get the information from &quot; + hostname&#x5B;i]);\n\t\t\t\tSystem.out.println(e);\n\t\t\t\ti++;\n\t\t\t}\n\t\t\tcatch(Exception e)\n\t\t\t{\n\t\t\t\tSystem.out.println(&quot;Failed to get the information from &quot; + hostname&#x5B;i]);\n\t\t\t\tSystem.out.println(e);\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\tif(i == 6)\n\t\t\tSystem.out.println(&quot;Failed to get the information please check your network settings.&quot;);\n\t\telse\n\t\t\tSystem.out.println(&quot;Complete.&quot;);\n\t}\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>import java.net.*; import java.io.*; public class DaytimeClient { \/** * @param args *\/ public static void main(String&#x5B;] args) { \/\/ TODO Auto-generated method stub String&#x5B;] hostname = new String&#x5B;]{&quot;&quot;, &quot;time.windows.com&quot;,&quot;time.nist.gov&quot;,&quot;time-nw.nist.gov&quot;,&quot;time-a.nist.gov&quot;,&quot;time-b.nist.gov&quot;}; int i = 1; boolean RecvFlag = false; if(args.length &amp;gt; 0) { hostname&#x5B;0] = args&#x5B;0]; i = 0; } while(i &amp;lt;=5 &amp;amp;&amp;amp; !RecvFlag) { try &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/zhuangzr.me\/wordpress\/2013\/07\/%e5%88%a9%e7%94%a8java%e8%8e%b7%e5%8f%96%e7%bd%91%e7%bb%9c%e6%a0%87%e5%87%86%e6%97%b6%e9%97%b4\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;\u5229\u7528Java\u83b7\u53d6\u7f51\u7edc\u6807\u51c6\u65f6\u95f4&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"class_list":["post-475","post","type-post","status-publish","format-standard","hentry","category-java"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.9 - aioseo.com -->\n\t<meta name=\"description\" content=\"[java]import java.net.*; import java.io.*; public class DaytimeClient { \/** * @param args *\/ public static void main(String[] args) { \/\/ TODO Auto-generated method stub String[] hostname = new String[]{&quot;&quot;, &quot;time.windows.com&quot;,&quot;time.nist.gov&quot;,&quot;time-nw.nist.gov&quot;,&quot;time-a.nist.gov&quot;,&quot;time-b.nist.gov&quot;}; int i = 1; boolean RecvFlag = false; if(args.length &gt; 0) { hostname[0] = args[0]; i = 0; } while(i\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"DeepSpace\"\/>\n\t<meta name=\"google-site-verification\" content=\"MU5z5UygVAc-wvTryHZh_Pyu9TTGhb65shw7AGmXpgE\" \/>\n\t<meta name=\"keywords\" content=\"java\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/zhuangzr.me\/wordpress\/2013\/07\/%e5%88%a9%e7%94%a8java%e8%8e%b7%e5%8f%96%e7%bd%91%e7%bb%9c%e6%a0%87%e5%87%86%e6%97%b6%e9%97%b4\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.9\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ZigZagRoad | Thoughts in Life and Research on Work\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\u5229\u7528Java\u83b7\u53d6\u7f51\u7edc\u6807\u51c6\u65f6\u95f4 | ZigZagRoad\" \/>\n\t\t<meta property=\"og:description\" content=\"[java]import java.net.*; import java.io.*; public class DaytimeClient { \/** * @param args *\/ public static void main(String[] args) { \/\/ TODO Auto-generated method stub String[] hostname = new String[]{&quot;&quot;, &quot;time.windows.com&quot;,&quot;time.nist.gov&quot;,&quot;time-nw.nist.gov&quot;,&quot;time-a.nist.gov&quot;,&quot;time-b.nist.gov&quot;}; int i = 1; boolean RecvFlag = false; if(args.length &gt; 0) { hostname[0] = args[0]; i = 0; } while(i\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/zhuangzr.me\/wordpress\/2013\/07\/%e5%88%a9%e7%94%a8java%e8%8e%b7%e5%8f%96%e7%bd%91%e7%bb%9c%e6%a0%87%e5%87%86%e6%97%b6%e9%97%b4\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/ziruizhuang.github.io\/assets\/img\/prof_pic.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/ziruizhuang.github.io\/assets\/img\/prof_pic.jpg\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2013-07-07T05:42:01+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2013-07-07T05:42:01+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"\u5229\u7528Java\u83b7\u53d6\u7f51\u7edc\u6807\u51c6\u65f6\u95f4 | ZigZagRoad\" \/>\n\t\t<meta name=\"twitter:description\" content=\"[java]import java.net.*; import java.io.*; public class DaytimeClient { \/** * @param args *\/ public static void main(String[] args) { \/\/ TODO Auto-generated method stub String[] hostname = new String[]{&quot;&quot;, &quot;time.windows.com&quot;,&quot;time.nist.gov&quot;,&quot;time-nw.nist.gov&quot;,&quot;time-a.nist.gov&quot;,&quot;time-b.nist.gov&quot;}; int i = 1; boolean RecvFlag = false; if(args.length &gt; 0) { hostname[0] = args[0]; i = 0; } while(i\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/ziruizhuang.github.io\/assets\/img\/prof_pic.jpg\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/2013\\\/07\\\/%e5%88%a9%e7%94%a8java%e8%8e%b7%e5%8f%96%e7%bd%91%e7%bb%9c%e6%a0%87%e5%87%86%e6%97%b6%e9%97%b4\\\/#article\",\"name\":\"\\u5229\\u7528Java\\u83b7\\u53d6\\u7f51\\u7edc\\u6807\\u51c6\\u65f6\\u95f4 | ZigZagRoad\",\"headline\":\"\\u5229\\u7528Java\\u83b7\\u53d6\\u7f51\\u7edc\\u6807\\u51c6\\u65f6\\u95f4\",\"author\":{\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/author\\\/deepspace\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/#person\"},\"datePublished\":\"2013-07-07T13:42:01+08:00\",\"dateModified\":\"2013-07-07T13:42:01+08:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/2013\\\/07\\\/%e5%88%a9%e7%94%a8java%e8%8e%b7%e5%8f%96%e7%bd%91%e7%bb%9c%e6%a0%87%e5%87%86%e6%97%b6%e9%97%b4\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/2013\\\/07\\\/%e5%88%a9%e7%94%a8java%e8%8e%b7%e5%8f%96%e7%bd%91%e7%bb%9c%e6%a0%87%e5%87%86%e6%97%b6%e9%97%b4\\\/#webpage\"},\"articleSection\":\"Java\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/2013\\\/07\\\/%e5%88%a9%e7%94%a8java%e8%8e%b7%e5%8f%96%e7%bd%91%e7%bb%9c%e6%a0%87%e5%87%86%e6%97%b6%e9%97%b4\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/#listItem\",\"name\":\"Study, Research and Work\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/#listItem\",\"position\":2,\"name\":\"Study, Research and Work\",\"item\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/computer-science\\\/#listItem\",\"name\":\"Computer Science\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/computer-science\\\/#listItem\",\"position\":3,\"name\":\"Computer Science\",\"item\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/computer-science\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/computer-science\\\/programming\\\/#listItem\",\"name\":\"Programming\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/#listItem\",\"name\":\"Study, Research and Work\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/computer-science\\\/programming\\\/#listItem\",\"position\":4,\"name\":\"Programming\",\"item\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/computer-science\\\/programming\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/computer-science\\\/programming\\\/java\\\/#listItem\",\"name\":\"Java\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/computer-science\\\/#listItem\",\"name\":\"Computer Science\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/computer-science\\\/programming\\\/java\\\/#listItem\",\"position\":5,\"name\":\"Java\",\"item\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/computer-science\\\/programming\\\/java\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/2013\\\/07\\\/%e5%88%a9%e7%94%a8java%e8%8e%b7%e5%8f%96%e7%bd%91%e7%bb%9c%e6%a0%87%e5%87%86%e6%97%b6%e9%97%b4\\\/#listItem\",\"name\":\"\\u5229\\u7528Java\\u83b7\\u53d6\\u7f51\\u7edc\\u6807\\u51c6\\u65f6\\u95f4\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/computer-science\\\/programming\\\/#listItem\",\"name\":\"Programming\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/2013\\\/07\\\/%e5%88%a9%e7%94%a8java%e8%8e%b7%e5%8f%96%e7%bd%91%e7%bb%9c%e6%a0%87%e5%87%86%e6%97%b6%e9%97%b4\\\/#listItem\",\"position\":6,\"name\":\"\\u5229\\u7528Java\\u83b7\\u53d6\\u7f51\\u7edc\\u6807\\u51c6\\u65f6\\u95f4\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/category\\\/study-research-work\\\/computer-science\\\/programming\\\/java\\\/#listItem\",\"name\":\"Java\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/#person\",\"name\":\"Hamilleton\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/author\\\/deepspace\\\/#author\",\"url\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/author\\\/deepspace\\\/\",\"name\":\"DeepSpace\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/2013\\\/07\\\/%e5%88%a9%e7%94%a8java%e8%8e%b7%e5%8f%96%e7%bd%91%e7%bb%9c%e6%a0%87%e5%87%86%e6%97%b6%e9%97%b4\\\/#webpage\",\"url\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/2013\\\/07\\\/%e5%88%a9%e7%94%a8java%e8%8e%b7%e5%8f%96%e7%bd%91%e7%bb%9c%e6%a0%87%e5%87%86%e6%97%b6%e9%97%b4\\\/\",\"name\":\"\\u5229\\u7528Java\\u83b7\\u53d6\\u7f51\\u7edc\\u6807\\u51c6\\u65f6\\u95f4 | ZigZagRoad\",\"description\":\"[java]import java.net.*; import java.io.*; public class DaytimeClient { \\\/** * @param args *\\\/ public static void main(String[] args) { \\\/\\\/ TODO Auto-generated method stub String[] hostname = new String[]{\\\"\\\", \\\"time.windows.com\\\",\\\"time.nist.gov\\\",\\\"time-nw.nist.gov\\\",\\\"time-a.nist.gov\\\",\\\"time-b.nist.gov\\\"}; int i = 1; boolean RecvFlag = false; if(args.length > 0) { hostname[0] = args[0]; i = 0; } while(i\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/2013\\\/07\\\/%e5%88%a9%e7%94%a8java%e8%8e%b7%e5%8f%96%e7%bd%91%e7%bb%9c%e6%a0%87%e5%87%86%e6%97%b6%e9%97%b4\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/author\\\/deepspace\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/author\\\/deepspace\\\/#author\"},\"datePublished\":\"2013-07-07T13:42:01+08:00\",\"dateModified\":\"2013-07-07T13:42:01+08:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/#website\",\"url\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/\",\"name\":\"ZigZagRoad\",\"description\":\"Thoughts in Life and Research on Work\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/zhuangzr.me\\\/wordpress\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\u5229\u7528Java\u83b7\u53d6\u7f51\u7edc\u6807\u51c6\u65f6\u95f4 | ZigZagRoad","description":"[java]import java.net.*; import java.io.*; public class DaytimeClient { \/** * @param args *\/ public static void main(String[] args) { \/\/ TODO Auto-generated method stub String[] hostname = new String[]{\"\", \"time.windows.com\",\"time.nist.gov\",\"time-nw.nist.gov\",\"time-a.nist.gov\",\"time-b.nist.gov\"}; int i = 1; boolean RecvFlag = false; if(args.length > 0) { hostname[0] = args[0]; i = 0; } while(i","canonical_url":"https:\/\/zhuangzr.me\/wordpress\/2013\/07\/%e5%88%a9%e7%94%a8java%e8%8e%b7%e5%8f%96%e7%bd%91%e7%bb%9c%e6%a0%87%e5%87%86%e6%97%b6%e9%97%b4\/","robots":"max-image-preview:large","keywords":"java","webmasterTools":{"google-site-verification":"MU5z5UygVAc-wvTryHZh_Pyu9TTGhb65shw7AGmXpgE","miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/zhuangzr.me\/wordpress\/2013\/07\/%e5%88%a9%e7%94%a8java%e8%8e%b7%e5%8f%96%e7%bd%91%e7%bb%9c%e6%a0%87%e5%87%86%e6%97%b6%e9%97%b4\/#article","name":"\u5229\u7528Java\u83b7\u53d6\u7f51\u7edc\u6807\u51c6\u65f6\u95f4 | ZigZagRoad","headline":"\u5229\u7528Java\u83b7\u53d6\u7f51\u7edc\u6807\u51c6\u65f6\u95f4","author":{"@id":"https:\/\/zhuangzr.me\/wordpress\/author\/deepspace\/#author"},"publisher":{"@id":"https:\/\/zhuangzr.me\/wordpress\/#person"},"datePublished":"2013-07-07T13:42:01+08:00","dateModified":"2013-07-07T13:42:01+08:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/zhuangzr.me\/wordpress\/2013\/07\/%e5%88%a9%e7%94%a8java%e8%8e%b7%e5%8f%96%e7%bd%91%e7%bb%9c%e6%a0%87%e5%87%86%e6%97%b6%e9%97%b4\/#webpage"},"isPartOf":{"@id":"https:\/\/zhuangzr.me\/wordpress\/2013\/07\/%e5%88%a9%e7%94%a8java%e8%8e%b7%e5%8f%96%e7%bd%91%e7%bb%9c%e6%a0%87%e5%87%86%e6%97%b6%e9%97%b4\/#webpage"},"articleSection":"Java"},{"@type":"BreadcrumbList","@id":"https:\/\/zhuangzr.me\/wordpress\/2013\/07\/%e5%88%a9%e7%94%a8java%e8%8e%b7%e5%8f%96%e7%bd%91%e7%bb%9c%e6%a0%87%e5%87%86%e6%97%b6%e9%97%b4\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress#listItem","position":1,"name":"Home","item":"https:\/\/zhuangzr.me\/wordpress","nextItem":{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/#listItem","name":"Study, Research and Work"}},{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/#listItem","position":2,"name":"Study, Research and Work","item":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/","nextItem":{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/#listItem","name":"Computer Science"},"previousItem":{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/#listItem","position":3,"name":"Computer Science","item":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/","nextItem":{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/programming\/#listItem","name":"Programming"},"previousItem":{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/#listItem","name":"Study, Research and Work"}},{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/programming\/#listItem","position":4,"name":"Programming","item":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/programming\/","nextItem":{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/programming\/java\/#listItem","name":"Java"},"previousItem":{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/#listItem","name":"Computer Science"}},{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/programming\/java\/#listItem","position":5,"name":"Java","item":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/programming\/java\/","nextItem":{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress\/2013\/07\/%e5%88%a9%e7%94%a8java%e8%8e%b7%e5%8f%96%e7%bd%91%e7%bb%9c%e6%a0%87%e5%87%86%e6%97%b6%e9%97%b4\/#listItem","name":"\u5229\u7528Java\u83b7\u53d6\u7f51\u7edc\u6807\u51c6\u65f6\u95f4"},"previousItem":{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/programming\/#listItem","name":"Programming"}},{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress\/2013\/07\/%e5%88%a9%e7%94%a8java%e8%8e%b7%e5%8f%96%e7%bd%91%e7%bb%9c%e6%a0%87%e5%87%86%e6%97%b6%e9%97%b4\/#listItem","position":6,"name":"\u5229\u7528Java\u83b7\u53d6\u7f51\u7edc\u6807\u51c6\u65f6\u95f4","previousItem":{"@type":"ListItem","@id":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/programming\/java\/#listItem","name":"Java"}}]},{"@type":"Person","@id":"https:\/\/zhuangzr.me\/wordpress\/#person","name":"Hamilleton"},{"@type":"Person","@id":"https:\/\/zhuangzr.me\/wordpress\/author\/deepspace\/#author","url":"https:\/\/zhuangzr.me\/wordpress\/author\/deepspace\/","name":"DeepSpace"},{"@type":"WebPage","@id":"https:\/\/zhuangzr.me\/wordpress\/2013\/07\/%e5%88%a9%e7%94%a8java%e8%8e%b7%e5%8f%96%e7%bd%91%e7%bb%9c%e6%a0%87%e5%87%86%e6%97%b6%e9%97%b4\/#webpage","url":"https:\/\/zhuangzr.me\/wordpress\/2013\/07\/%e5%88%a9%e7%94%a8java%e8%8e%b7%e5%8f%96%e7%bd%91%e7%bb%9c%e6%a0%87%e5%87%86%e6%97%b6%e9%97%b4\/","name":"\u5229\u7528Java\u83b7\u53d6\u7f51\u7edc\u6807\u51c6\u65f6\u95f4 | ZigZagRoad","description":"[java]import java.net.*; import java.io.*; public class DaytimeClient { \/** * @param args *\/ public static void main(String[] args) { \/\/ TODO Auto-generated method stub String[] hostname = new String[]{\"\", \"time.windows.com\",\"time.nist.gov\",\"time-nw.nist.gov\",\"time-a.nist.gov\",\"time-b.nist.gov\"}; int i = 1; boolean RecvFlag = false; if(args.length > 0) { hostname[0] = args[0]; i = 0; } while(i","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/zhuangzr.me\/wordpress\/#website"},"breadcrumb":{"@id":"https:\/\/zhuangzr.me\/wordpress\/2013\/07\/%e5%88%a9%e7%94%a8java%e8%8e%b7%e5%8f%96%e7%bd%91%e7%bb%9c%e6%a0%87%e5%87%86%e6%97%b6%e9%97%b4\/#breadcrumblist"},"author":{"@id":"https:\/\/zhuangzr.me\/wordpress\/author\/deepspace\/#author"},"creator":{"@id":"https:\/\/zhuangzr.me\/wordpress\/author\/deepspace\/#author"},"datePublished":"2013-07-07T13:42:01+08:00","dateModified":"2013-07-07T13:42:01+08:00"},{"@type":"WebSite","@id":"https:\/\/zhuangzr.me\/wordpress\/#website","url":"https:\/\/zhuangzr.me\/wordpress\/","name":"ZigZagRoad","description":"Thoughts in Life and Research on Work","inLanguage":"en-US","publisher":{"@id":"https:\/\/zhuangzr.me\/wordpress\/#person"}}]},"og:locale":"en_US","og:site_name":"ZigZagRoad | Thoughts in Life and Research on Work","og:type":"article","og:title":"\u5229\u7528Java\u83b7\u53d6\u7f51\u7edc\u6807\u51c6\u65f6\u95f4 | ZigZagRoad","og:description":"[java]import java.net.*; import java.io.*; public class DaytimeClient { \/** * @param args *\/ public static void main(String[] args) { \/\/ TODO Auto-generated method stub String[] hostname = new String[]{&quot;&quot;, &quot;time.windows.com&quot;,&quot;time.nist.gov&quot;,&quot;time-nw.nist.gov&quot;,&quot;time-a.nist.gov&quot;,&quot;time-b.nist.gov&quot;}; int i = 1; boolean RecvFlag = false; if(args.length &gt; 0) { hostname[0] = args[0]; i = 0; } while(i","og:url":"https:\/\/zhuangzr.me\/wordpress\/2013\/07\/%e5%88%a9%e7%94%a8java%e8%8e%b7%e5%8f%96%e7%bd%91%e7%bb%9c%e6%a0%87%e5%87%86%e6%97%b6%e9%97%b4\/","og:image":"https:\/\/ziruizhuang.github.io\/assets\/img\/prof_pic.jpg","og:image:secure_url":"https:\/\/ziruizhuang.github.io\/assets\/img\/prof_pic.jpg","article:published_time":"2013-07-07T05:42:01+00:00","article:modified_time":"2013-07-07T05:42:01+00:00","twitter:card":"summary","twitter:title":"\u5229\u7528Java\u83b7\u53d6\u7f51\u7edc\u6807\u51c6\u65f6\u95f4 | ZigZagRoad","twitter:description":"[java]import java.net.*; import java.io.*; public class DaytimeClient { \/** * @param args *\/ public static void main(String[] args) { \/\/ TODO Auto-generated method stub String[] hostname = new String[]{&quot;&quot;, &quot;time.windows.com&quot;,&quot;time.nist.gov&quot;,&quot;time-nw.nist.gov&quot;,&quot;time-a.nist.gov&quot;,&quot;time-b.nist.gov&quot;}; int i = 1; boolean RecvFlag = false; if(args.length &gt; 0) { hostname[0] = args[0]; i = 0; } while(i","twitter:image":"https:\/\/ziruizhuang.github.io\/assets\/img\/prof_pic.jpg"},"aioseo_meta_data":{"post_id":"475","title":"\u5229\u7528Java\u83b7\u53d6\u7f51\u7edc\u6807\u51c6\u65f6\u95f4 | #site_title","description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[],"defaultGraph":"","defaultPostTypeGraph":""},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2020-12-24 07:00:03","updated":"2025-07-03 08:49:46","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/zhuangzr.me\/wordpress\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/\" title=\"Study, Research and Work\">Study, Research and Work<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/\" title=\"Computer Science\">Computer Science<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/programming\/\" title=\"Programming\">Programming<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/programming\/java\/\" title=\"Java\">Java<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t\u5229\u7528Java\u83b7\u53d6\u7f51\u7edc\u6807\u51c6\u65f6\u95f4\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/zhuangzr.me\/wordpress"},{"label":"Study, Research and Work","link":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/"},{"label":"Computer Science","link":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/"},{"label":"Programming","link":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/programming\/"},{"label":"Java","link":"https:\/\/zhuangzr.me\/wordpress\/category\/study-research-work\/computer-science\/programming\/java\/"},{"label":"\u5229\u7528Java\u83b7\u53d6\u7f51\u7edc\u6807\u51c6\u65f6\u95f4","link":"https:\/\/zhuangzr.me\/wordpress\/2013\/07\/%e5%88%a9%e7%94%a8java%e8%8e%b7%e5%8f%96%e7%bd%91%e7%bb%9c%e6%a0%87%e5%87%86%e6%97%b6%e9%97%b4\/"}],"_links":{"self":[{"href":"https:\/\/zhuangzr.me\/wordpress\/wp-json\/wp\/v2\/posts\/475","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zhuangzr.me\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zhuangzr.me\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zhuangzr.me\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/zhuangzr.me\/wordpress\/wp-json\/wp\/v2\/comments?post=475"}],"version-history":[{"count":0,"href":"https:\/\/zhuangzr.me\/wordpress\/wp-json\/wp\/v2\/posts\/475\/revisions"}],"wp:attachment":[{"href":"https:\/\/zhuangzr.me\/wordpress\/wp-json\/wp\/v2\/media?parent=475"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zhuangzr.me\/wordpress\/wp-json\/wp\/v2\/categories?post=475"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zhuangzr.me\/wordpress\/wp-json\/wp\/v2\/tags?post=475"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}