{"width":"100%","blog_title":"30\u6b73\u304b\u3089\u306e\u30d6\u30e9\u30a6\u30b6\u3065\u304f\u308a","type":"rich","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmozxxx.hatenadiary.org%2Fentry%2F20110528%2Fp3\" title=\"HTTP Client \u306e\u52d5\u4f5c\u30d5\u30ed\u30fc \u305d\u306e8 : read() \u3067\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u8aad\u307f\u8fbc\u3080 - 30\u6b73\u304b\u3089\u306e\u30d6\u30e9\u30a6\u30b6\u3065\u304f\u308a\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_name":"mozxxx","provider_url":"https://hatena.blog","image_url":null,"version":"1.0","author_url":"https://blog.hatena.ne.jp/mozxxx/","blog_url":"https://mozxxx.hatenadiary.org/","categories":["UserAgent"],"description":"write()\u3067HTTP\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u30b5\u30fc\u30d0\u306b\u9001\u4fe1\u3057\u305f\u3042\u3068\u306f\u3001read()\u95a2\u6570\u3067\u30b5\u30fc\u30d0\u304b\u3089\u306eHTTP\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002 \u4f8b //\u30d0\u30c3\u30d5\u30a1\u3092\u7a7a\u306b memset(buf, 0, sizeof(buf)); //\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u53d7\u4fe1\u3057\u3066\u51fa\u529b do { //\u30d0\u30c3\u30d5\u30a1\u5206\u8aad\u307f\u8fbc\u3080 n = read(sfd, buf, sizeof(buf)); //\u6a19\u6e96\u51fa\u529b\u306b\u8868\u793a if(write(STDOUT_FILENO, buf, n) < 0) { perror(\"write STDOUT\"); return 1; } } while(n > 0); //\u30a8\u30e9\u30fc\u51e6\u7406 if(n == -1) { perror(\"\u2026","provider_name":"Hatena Blog","title":"HTTP Client \u306e\u52d5\u4f5c\u30d5\u30ed\u30fc \u305d\u306e8 : read() \u3067\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u8aad\u307f\u8fbc\u3080","height":"190","published":"2011-05-28 00:00:00","url":"https://mozxxx.hatenadiary.org/entry/20110528/p3"}