{"id":17391,"date":"2025-04-18T23:52:34","date_gmt":"2025-04-18T15:52:34","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/17391.html"},"modified":"2025-04-18T23:52:34","modified_gmt":"2025-04-18T15:52:34","slug":"io%e5%a4%9a%e8%b7%af%e5%a4%8d%e7%94%a8%e5%ae%9e%e7%8e%b0%e5%b9%b6%e5%8f%91%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/17391.html","title":{"rendered":"IO\u591a\u8def\u590d\u7528\u5b9e\u73b0\u5e76\u53d1\u670d\u52a1\u5668"},"content":{"rendered":"<h2>\u4e00.select\u51fd\u6570<\/h2>\n<p>select \u7684\u8c03\u7528\u6ce8\u610f\u4e8b\u9879 \u5728\u4f7f\u7528 select \u51fd\u6570\u65f6&#xff0c;\u9700\u8981\u6ce8\u610f\u4ee5\u4e0b\u51e0\u4e2a\u5173\u952e\u70b9&#xff1a;<\/p>\n<p>1. \u53c2\u6570\u7684\u4fee\u6539\u4e0e\u62f7\u8d1d \u00a0 \u00a0readfds \u7b49\u53c2\u6570\u662f\u7ed3\u679c\u53c2\u6570 &#xff1a; \u00a0 \u00a0select \u51fd\u6570\u4f1a\u76f4\u63a5\u4fee\u6539\u4f20\u5165\u7684 fd_set&#xff08;\u5982 readfds\u3001writefds \u548c exceptfds&#xff09;\u3002 \u00a0 \u00a0\u4e3a\u4e86\u4fdd\u7559\u539f\u59cb\u76d1\u542c\u96c6\u5408&#xff0c;\u901a\u5e38\u4f1a\u5b9a\u4e49\u4e00\u4e2a\u5907\u4efd\u96c6\u5408&#xff08;\u5982 allread_fdset&#xff09;&#xff0c;\u5e76\u5c06\u5b83\u7684\u62f7\u8d1d\u4f20\u9012\u7ed9 select\u3002 \u00a0\u00a0 \u00a0\u793a\u4f8b&#xff1a; \u00a0\u00a0 \u00a0fd_set allread_fdset, readfds; \u00a0\u00a0 \u00a0FD_ZERO(&amp;allread_fdset); \u00a0\u00a0 \u00a0FD_SET(fd1, &amp;allread_fdset); \u00a0\u00a0 \u00a0FD_SET(fd2, &amp;allread_fdset);<\/p>\n<p>\u00a0\u00a0 \u00a0readfds &#061; allread_fdset; \/\/ \u62f7\u8d1d\u5230\u4e34\u65f6\u96c6\u5408 \u00a0\u00a0 \u00a0select(&#8230;, &amp;readfds, &#8230;); 2. \u8ba1\u7b97 nfds<\/p>\n<p>\u00a0\u00a0 \u00a0nfds \u662f\u6700\u5927\u6587\u4ef6\u63cf\u8ff0\u7b26\u503c &#043; 1 &#xff1a; \u00a0\u00a0 \u00a0\u5728\u65b0\u589e\u76d1\u542c\u53e5\u67c4\u65f6&#xff0c;\u66f4\u65b0 nfds \u8f83\u4e3a\u7b80\u5355\u3002 \u00a0\u00a0 \u00a0\u5728\u51cf\u5c11\u76d1\u542c\u53e5\u67c4\u65f6&#xff0c;\u66f4\u65b0 nfds \u8f83\u4e3a\u590d\u6742&#xff1a; \u00a0\u00a0 \u00a0\u5982\u679c\u9700\u8981\u7cbe\u786e\u8ba1\u7b97&#xff0c;\u53ef\u4ee5\u901a\u8fc7\u904d\u5386\u6216\u7ef4\u62a4\u4e00\u4e2a\u6700\u5927\u5806\u7b49\u6570\u636e\u7ed3\u6784\u6765\u627e\u5230\u7b2c\u4e8c\u5927\u7684\u6587\u4ef6\u63cf\u8ff0\u7b26\u3002 \u00a0\u00a0 \u00a0\u6216\u8005&#xff0c;\u53ef\u4ee5\u9009\u62e9\u5ffd\u7565 nfds \u7684\u66f4\u65b0&#xff0c;\u4f46\u53ef\u80fd\u5bfc\u81f4\u6027\u80fd\u4e0b\u964d\u3002 \u00a0\u00a0 \u00a0 \u00a0\u00a0 \u00a0 3. \u8d85\u65f6\u53c2\u6570 timeout \u00a0\u00a0 \u00a0timeout \u7684\u542b\u4e49 &#xff1a; \u00a0\u00a0 \u00a0\u5982\u679c\u4e3a NULL&#xff0c;\u8868\u793a\u963b\u585e\u7b49\u5f85&#xff0c;\u76f4\u5230\u6709\u4e8b\u4ef6\u53d1\u751f\u3002 \u00a0\u00a0 \u00a0\u5982\u679c\u6307\u5411\u7684\u65f6\u95f4\u4e3a 0&#xff0c;\u8868\u793a\u975e\u963b\u585e\u6a21\u5f0f\u3002 \u00a0\u00a0 \u00a0\u5982\u679c\u6307\u5b9a\u8d85\u65f6\u65f6\u95f4&#xff0c;\u5219 select \u4f1a\u5728\u8d85\u65f6\u540e\u8fd4\u56de\u3002 \u00a0\u00a0 \u00a0\u6ce8\u610f&#xff1a;Linux \u5b9e\u73b0\u4e2d&#xff0c;select \u8fd4\u56de\u65f6\u4f1a\u4fee\u6539 timeout \u4e3a\u5269\u4f59\u65f6\u95f4 &#xff1a; \u00a0\u00a0 \u00a0\u5982\u679c\u9700\u8981\u91cd\u590d\u4f7f\u7528 timeout&#xff0c;\u9700\u8981\u91cd\u65b0\u521d\u59cb\u5316\u3002 \u00a0\u00a0 \u00a0 4. \u8fd4\u56de\u503c\u7684\u5904\u7406 \u00a0\u00a0 \u00a0\u8fd4\u56de\u503c\u7684\u610f\u4e49 &#xff1a; \u00a0\u00a0 \u00a0-1&#xff1a;\u8868\u793a\u9519\u8bef\u3002 \u00a0\u00a0 \u00a00&#xff1a;\u8868\u793a\u8d85\u65f6\u65f6\u95f4\u5230&#xff0c;\u6ca1\u6709\u4e8b\u4ef6\u53d1\u751f\u3002 \u00a0\u00a0 \u00a0\u6b63\u6570&#xff1a;\u8868\u793a\u76d1\u542c\u5230\u7684\u4e8b\u4ef6\u603b\u6570&#xff08;\u5305\u62ec\u53ef\u8bfb\u3001\u53ef\u5199\u548c\u5f02\u5e38\u4e8b\u4ef6&#xff09;\u3002 \u00a0\u00a0 \u00a0\u4f18\u5316\u4e8b\u4ef6\u5904\u7406 &#xff1a; \u00a0\u00a0 \u00a0\u53ef\u4ee5\u5229\u7528\u8fd4\u56de\u503c\u907f\u514d\u4e0d\u5fc5\u8981\u7684\u68c0\u67e5\u3002\u4f8b\u5982&#xff0c;\u5982\u679c\u8fd4\u56de\u503c\u4e3a 1&#xff0c;\u5e76\u4e14\u5df2\u7ecf\u5728\u53ef\u8bfb\u96c6\u5408\u4e2d\u5904\u7406\u4e86\u4e00\u4e2a\u4e8b\u4ef6&#xff0c;\u5219\u65e0\u9700\u518d\u68c0\u67e5\u53ef\u5199\u548c\u5f02\u5e38\u96c6\u5408\u3002<\/p>\n<p>select \u7684\u7f3a\u70b9 \u00a0\u00a0 \u00a0\u5c3d\u7ba1 select \u662f\u4e00\u79cd\u7ecf\u5178\u7684 I\/O \u591a\u8def\u590d\u7528\u673a\u5236&#xff0c;\u4f46\u5b83\u5b58\u5728\u4ee5\u4e0b\u663e\u8457\u7f3a\u70b9&#xff1a;<\/p>\n<p>\u00a0\u00a0 \u00a01. \u6587\u4ef6\u63cf\u8ff0\u7b26\u6570\u91cf\u9650\u5236 \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0FD_SETSIZE \u7684\u9650\u5236 &#xff1a; \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u6bcf\u4e2a fd_set \u6700\u591a\u53ea\u80fd\u76d1\u542c FD_SETSIZE \u4e2a\u6587\u4ef6\u63cf\u8ff0\u7b26&#xff08;\u5728 Linux \u4e0a\u901a\u5e38\u662f 1024&#xff09;\u3002 \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u8fd9\u4e00\u9650\u5236\u4f7f\u5f97 select \u4e0d\u9002\u5408\u9ad8\u5e76\u53d1\u573a\u666f\u3002 \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0 \u00a0\u00a0 \u00a02. \u904d\u5386\u6548\u7387\u4f4e \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u9700\u8981\u9010\u4e00\u68c0\u67e5\u6587\u4ef6\u63cf\u8ff0\u7b26 &#xff1a; \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u8fd4\u56de\u7684 fd_set \u662f\u4e00\u4e2a\u4f4d\u56fe&#xff0c;\u5e94\u7528\u7a0b\u5e8f\u9700\u8981\u5bf9\u6240\u6709\u76d1\u542c\u7684\u6587\u4ef6\u63cf\u8ff0\u7b26\u9010\u4e00\u8c03\u7528 FD_ISSET \u6765\u5224\u65ad\u662f\u5426\u5c31\u7eea\u3002 \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u793a\u4f8b&#xff1a;<\/p>\n<p>\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0for (int i &#061; 0; i &lt; nfds; i&#043;&#043;) { \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0if (FD_ISSET(i, &amp;readfds)) { \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\/\/ \u5904\u7406\u53ef\u8bfb\u4e8b\u4ef6 \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0} \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0} 3. nfds \u7684\u6548\u7387\u95ee\u9898 \u00a0\u00a0 \u00a0select \u7684\u5b9e\u73b0\u65b9\u5f0f &#xff1a; \u00a0\u00a0 \u00a0select \u5185\u90e8\u4f1a\u904d\u5386\u4ece 0 \u5230 nfds-1 \u7684\u6240\u6709\u6587\u4ef6\u63cf\u8ff0\u7b26&#xff0c;\u5224\u65ad\u6bcf\u4e2a\u63cf\u8ff0\u7b26\u662f\u5426\u662f\u5173\u5fc3\u7684&#xff0c;\u5e76\u68c0\u67e5\u662f\u5426\u6709\u4e8b\u4ef6\u53d1\u751f\u3002 \u00a0\u00a0 \u00a0\u5373\u4f7f\u53ea\u76d1\u542c\u5c11\u6570\u51e0\u4e2a\u6587\u4ef6\u63cf\u8ff0\u7b26&#xff08;\u5982 0 \u548c 1000&#xff09;&#xff0c;select \u4ecd\u7136\u9700\u8981\u904d\u5386 1001 \u4e2a\u63cf\u8ff0\u7b26&#xff0c;\u5bfc\u81f4\u6548\u7387\u4f4e\u4e0b\u3002<\/p>\n<p> \u603b\u7ed3 \u4f18\u70b9 \u00a0 \u00a0 \u7b80\u5355\u6613\u7528&#xff0c;\u8de8\u5e73\u53f0\u652f\u6301\u5e7f\u6cdb\u3002 \u7f3a\u70b9 \u00a0\u00a0 \u00a0\u6587\u4ef6\u63cf\u8ff0\u7b26\u6570\u91cf\u53d7\u9650 &#xff1a;\u6700\u591a\u53ea\u80fd\u76d1\u542c FD_SETSIZE \u4e2a\u6587\u4ef6\u63cf\u8ff0\u7b26\u3002 \u00a0\u00a0 \u00a0\u904d\u5386\u6548\u7387\u4f4e \u00a0 \u00a0 \u00a0 \u00a0 &#xff1a;\u9700\u8981\u9010\u4e00\u68c0\u67e5\u6587\u4ef6\u63cf\u8ff0\u7b26&#xff0c;\u589e\u52a0\u4e86\u5f00\u9500\u3002 \u00a0\u00a0 \u00a0nfds \u7684\u95ee\u9898 \u00a0 \u00a0 \u00a0 \u00a0&#xff1a;\u5373\u4f7f\u76d1\u542c\u7684\u6587\u4ef6\u63cf\u8ff0\u7b26\u7a00\u758f\u5206\u5e03&#xff0c;select \u4ecd\u9700\u904d\u5386\u6240\u6709\u5c0f\u4e8e nfds \u7684\u63cf\u8ff0\u7b26\u3002 \u8fd9\u4e9b\u7f3a\u70b9\u4fc3\u4f7f\u4e86\u66f4\u9ad8\u6548\u7684 I\/O \u591a\u8def\u590d\u7528\u673a\u5236&#xff08;\u5982 poll \u548c epoll&#xff09;\u7684\u51fa\u73b0&#xff0c;\u5c24\u5176\u662f\u5728\u9ad8\u5e76\u53d1\u573a\u666f\u4e0b&#xff0c;epoll \u6210\u4e3a\u4e86\u66f4\u4f18\u7684\u9009\u62e9\u3002<\/p>\n<h4>\u30101\u3011\u7ba1\u9053select<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"673\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418155230-6802753edf06e.png\" width=\"515\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1053\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418155231-6802753f07bde.png\" width=\"544\" \/><\/p>\n<h4>\u30102\u3011tcp\u670d\u52a1\u5668select<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"589\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418155231-6802753f3b79a.png\" width=\"748\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1218\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418155231-6802753f5a59f.png\" width=\"706\" \/><\/p>\n<\/p>\n<h2>\u4e8c.poll\u51fd\u6570<\/h2>\n<p>poll\u00a0 \u00a0 \u00a0\u9488\u5bf9select \u505a\u4e86\u6539\u8fdb\u00a0 \u00a0 \u00a0\u5e95\u5c42\u5b9e\u73b0 &#8212; \u7528\u7684\u662f\u6570\u7ec4\u00a0 \u00a0 \u00a0poll &#8212; \u94fe\u8868\u00a0 \u00a0 \u00a0poll \u5f15\u5165\u4e86\u4e8b\u4ef6\u673a\u5236\u00a0 \u00a0 \u00a0 \u00a0 \u00a01. \u904d\u5386? \u00a0 \u00a02. poll \u9700\u8981\u5728 \u7528\u6237\u7a7a\u95f4 \u548c \u5185\u6838\u7a7a\u95f4 \u6765\u56de\u62f7\u8d1d\u00a0<\/p>\n<p>epoll\u00a0 \u00a0 \u00a0\u4e09\u79cd\u591a\u8defIO\u64cd\u4f5c\u4e2d\u6700\u9ad8\u6548<\/p>\n<p> \u00a0 \u00a0 \u00a0<\/p>\n<h2>\u4e09.epoll\u51fd\u6570<\/h2>\n<p>3. epoll int epoll_create(int size); int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event);<\/p>\n<p>typedef union epoll_data { \u00a0\u00a0 \u00a0void *ptr; \u00a0\u00a0 \u00a0int fd; \u00a0\u00a0 \u00a0__uint32_t u32; \u00a0\u00a0 \u00a0__uint64_t u64; } epoll_data_t;<\/p>\n<p>struct epoll_event { \u00a0\u00a0 \u00a0__uint32_t events; \u00a0 \u00a0 \u00a0\/* Epoll events *\/ \u00a0\u00a0 \u00a0epoll_data_t data; \u00a0 \u00a0 \u00a0\/* User data variable *\/ }; int epoll_wait(int epfd, struct epoll_event * events, int maxevents, int timeout);<\/p>\n<p> epoll \u89e3\u51b3\u4e86select\u548cpoll\u7684\u51e0\u4e2a\u6027\u80fd\u4e0a\u7684\u7f3a\u9677&#xff1a; \u2460 \u4e0d\u9650\u5236\u76d1\u542c\u7684\u63cf\u8ff0\u7b26\u4e2a\u6570&#xff08;poll\u4e5f\u662f&#xff09;&#xff0c;\u53ea\u53d7\u8fdb\u7a0b\u6253\u5f00\u63cf\u8ff0\u7b26\u603b\u6570\u7684\u9650\u5236&#xff1b; \u2461 \u76d1\u542c\u6027\u80fd\u4e0d\u968f\u7740\u76d1\u542c\u63cf\u8ff0 \u7b26\u6570\u7684\u589e\u52a0\u800c\u589e\u52a0&#xff0c;\u662fO(1) \u7684&#xff0c; \u00a0 \u4e0d\u518d\u662f\u8f6e\u8be2\u63cf\u8ff0\u7b26\u6765\u63a2\u6d4b\u4e8b\u4ef6&#xff0c;\u800c\u662f\u7531\u63cf\u8ff0\u7b26\u4e3b\u52a8\u4e0a\u62a5\u4e8b\u4ef6&#xff1b; \/\/\u4e8b\u4ef6\u673a\u5236\u7684\u00a0 \u2462 \u4f7f\u7528\u5171\u4eab\u5185\u5b58\u7684\u65b9\u5f0f&#xff0c;\u4e0d\u5728\u7528\u6237\u548c\u5185\u6838\u4e4b\u95f4\u53cd\u590d\u4f20\u9012\u76d1\u542c\u7684\u63cf\u8ff0 \u7b26\u4fe1\u606f&#xff1b; \u2463 \u8fd4\u56de\u53c2\u6570\u4e2d\u5c31\u662f\u89e6\u53d1\u4e8b\u4ef6\u7684\u5217\u8868&#xff0c;\u4e0d\u7528\u518d\u904d\u5386\u8f93\u5165\u4e8b\u4ef6\u8868\u67e5\u8be2\u5404\u4e2a\u4e8b\u4ef6\u662f\u5426\u88ab\u89e6\u53d1<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>epoll\u663e\u8457\u63d0\u9ad8\u6027\u80fd\u7684\u524d\u63d0\u662f&#xff1a; \u76d1\u542c\u5927\u91cf\u63cf\u8ff0\u7b26&#xff0c; \u5e76\u4e14\u6bcf\u6b21\u89e6\u53d1\u4e8b\u4ef6\u7684\u63cf\u8ff0\u7b26\u6587\u4ef6\u975e\u5e38\u5c11\u3002 epoll\u7684\u53e6\u5916\u533a\u522b\u662f&#xff1a; \u2460epoll\u521b\u5efa\u4e86\u63cf\u8ff0\u7b26&#xff0c;\u8bb0\u5f97close&#xff1b; \u2461\u652f\u6301\u6c34\u5e73\u89e6\u53d1\u548c\u8fb9\u6cbf\u89e6\u53d1\u3002<\/p>\n<p>epoll\u4f7f\u7528\u6ce8\u610f\u4e8b\u9879&#xff1a; \/\/epoll_create \u2460 int epoll_create(int size)&#xff1b; \u00a0 \u00a0\/\/\u521b\u5efaepoll\u6587\u4ef6\u63cf\u8ff0\u7b26 \u53c2\u6570size\u5e76\u4e0d\u662f\u9650\u5236\u4e86epoll\u6240\u80fd\u76d1\u542c\u7684\u63cf\u8ff0\u7b26\u6700\u5927\u4e2a\u6570&#xff0c; \u53ea\u662f\u5bf9\u5185\u6838\u521d\u59cb\u5206\u914d\u5185\u90e8\u6570\u636e\u7ed3\u6784\u7684\u4e00\u4e2a\u5efa\u8bae\u3002 \u8fd4\u56de\u662fepoll\u63cf\u8ff0\u7b26\u3002-1\u8868\u793a\u521b\u5efa\u5931\u8d25\u3002<\/p>\n<p> \/\/epoll_ctl \u2461 int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event)&#xff1b; \u00a0 \u00a0\/\/epoll\u6587\u4ef6\u63cf\u8ff0\u7b26\u7684\u63a7\u5236\u63a5\u53e3 \u529f\u80fd: \u00a0 \u00a0 \u00a0epoll_ctl\u63a7\u5236\u5bf9\u6307\u5b9a\u63cf\u8ff0\u7b26fd\u6267\u884cop\u64cd\u4f5c&#xff0c;event\u662f\u4e0efd\u5173\u8054\u7684\u76d1\u542c\u4e8b\u4ef6\u3002 \u53c2\u6570: \u00a0 \u00a0&#064;epfd &#8212; epoll\u5bf9\u8c61\u00a0 \u00a0 \u00a0&#064;op\u00a0 \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0op\u64cd\u4f5c\u6709\u4e09\u79cd&#xff1a; \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0 \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u6dfb\u52a0EPOLL_CTL_ADD&#xff0c; \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0 \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u5220\u9664EPOLL_CTL_DEL&#xff0c; \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0 \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u4fee\u6539EPOLL_CTL_MOD\u3002 \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0 \u00a0\u00a0 \u00a0\u5206\u522b\u6dfb\u52a0\u3001\u5220\u9664\u548c\u4fee\u6539\u5bf9fd\u7684\u76d1\u542c\u4e8b\u4ef6\u3002 \u00a0\u00a0 \u00a0\u91cd\u590d\u6dfb\u52a0fd\u4f1a\u600e\u6837&#xff08;event\u76f8\u540c\u6216\u4e0d\u76f8\u540c&#xff09;&#xff1a; \u00a0\u00a0 \u00a0\u6dfb\u52a0\u5931\u8d25&#xff08;errno&#xff1a;17&#xff0c; File exists&#xff09; \u00a0\u00a0 \u00a0\u5220\u9664\u548c\u4fee\u6539\u4e0d\u5b58\u5728\u7684fd\u4f1a\u600e\u6837&#xff1a; \u00a0\u00a0 \u00a0\u5220\u9664\u6216\u4fee\u6539\u5931\u8d25&#xff08;errno&#xff1a;9&#xff0c;Bad file descriptor&#xff09;<\/p>\n<p>\u00a0 &#064;fd &#8212; \u5173\u5fc3\u7684fd\u00a0 \u00a0\u00a0 \u00a0\u00a0 event\u662f\u4e0e\u76d1\u542c\u7684fd\u76f8\u5173\u8054\u7684\u4e8b\u4ef6\u4fe1\u606f&#xff0c;event-&gt;events\u63cf\u8ff0\u4e86\u8981\u76d1\u542c\u7684\u4e8b\u4ef6\u7c7b\u578b&#xff0c;\u6709\u4ee5\u4e0b\u7c7b\u578b&#xff1a; \/\/\u4e8b\u4ef6\u7c7b\u578b: EPOLLIN \u00a0 \u00a0 \u00a0 \u00a0\u53ef\u8bfb EPOLLOUT \u00a0 \u00a0 \u00a0 \u53ef\u5199 EPOLLRDHUP \u00a0 \u00a0 \u5957\u63a5\u53e3\u5bf9\u7aefclose\u6216shutdown\u5199&#xff0c;\u5728ET\u6a21\u5f0f\u4e0b\u6bd4\u8f83\u6709\u7528 EPOLLPRI \u00a0 \u00a0 \u00a0 \u7d27\u6025\u6570\u636e\u53ef\u8bfb EPOLLERR \u00a0 \u00a0 \u00a0 \u5f02\u5e38\u6761\u4ef6 EPOLLHUP \u00a0 \u00a0 \u00a0 \u6302\u8d77&#xff0c;EPOLLERR\u548cEPOLLHUP\u59cb\u7ec8\u7531epoll_wait\u76d1\u542c&#xff0c;\u4e0d\u9700\u8981\u7528\u6237\u8bbe\u7f6e EPOLLET \u00a0 \u00a0 \u00a0 \u00a0\u8fb9\u6cbf\u89e6\u53d1\u6a21\u5f0f&#xff0c;\u5728\u63cf\u8ff0\u7b26\u72b6\u6001\u8df3\u53d8\u65f6\u624d\u4e0a\u62a5\u76d1\u542c\u4e8b\u4ef6\u3002&#xff08;\u76d1\u542c\u9ed8\u8ba4\u90fd\u662fLT\u6a21\u5f0f&#xff09;(ET&#043;\u975e\u963b\u585e\u6a21\u5f0f) EPOLLONESHOT \u00a0 \u53ea\u4e00\u6b21\u6709\u6548&#xff0c;\u8bbe\u7f6eoneshot\u6807\u8bb0&#xff0c;\u63cf\u8ff0\u7b26\u5728\u89e6\u53d1\u4e00\u6b21\u4e8b\u4ef6\u4e4b\u540e\u81ea\u52a8\u5931\u6548&#xff08;fd\u8fd8\u88ab\u76d1\u542c&#xff09;&#xff0c; \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u4e0d\u4f1a\u518d\u4e0a\u62a5\u4efb\u4f55\u4e8b\u4ef6&#xff0c;\u76f4\u5230\u4f7f\u7528EPOLL_CTL_MOD\u91cd\u65b0\u6fc0\u6d3b&#xff0c; \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u8bbe\u7f6e\u65b0\u7684\u76d1\u542c\u4e8b\u4ef6\u4e3a\u6b62&#xff08;\u53ef\u4e0d\u53ef\u4ee5\u548c\u4e4b\u524d\u7684\u4e8b\u4ef6\u4e00\u6837&#xff1f;&#xff09;\u3002<\/p>\n<p>event-&gt;data\u662f\u4e2a\u5171\u7528\u4f53&#xff0c;\u53ef\u4ee5\u5b58\u653e\u548cfd\u7ed1\u5b9a\u7684\u63cf\u8ff0\u7b26\u4fe1\u606f&#xff0c; \u6bd4\u5982\u5c31\u5b58\u653e\u63cf\u8ff0\u7b26\u672c\u8eabfd&#xff0c;\u6216\u8005\u4e00\u4e2a\u7ed3\u6784\u4f53\u4fe1\u606f&#xff0c;\u5305\u62ecfd&#xff0c;ip&#xff0c;port\u7b49\u7b49\u3002<\/p>\n<p>\u5728epoll_wait\u8fd4\u56de\u65f6&#xff0c;\u53ea\u4f1a\u8fd4\u56de\u4e00\u4e2aevent\u5217\u8868&#xff0c;\u9700\u8981\u4ece\u5217\u8868\u5143\u7d20\u4e2d\u83b7\u53d6fd\u7b49\u4fe1\u606f\u3002 \u8fd4\u56de\u503c: \u00a0 \u00a0 \u00a0 \u00a0 \u8fd4\u56de0\u8868\u793a\u63a7\u5236\u6210\u529f&#xff0c; \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u8fd4\u56de-1\u8868\u793a\u5931\u8d25\u3002<\/p>\n<p>\u2462 int epoll_wait(int epfd, struct epoll_event * events, int maxevents, int timeout); \/\/\u7b49\u5f85epfd\u4e0a\u7684io\u4e8b\u4ef6&#xff0c;\u6700\u591a\u8fd4\u56demaxevents\u4e2a\u4e8b\u4ef6 timeout &#061; -1 \u7684\u884c\u4e3a\u662fblock&#xff1b; timeout &#061; \u00a00 \u662f\u7acb\u5373\u8fd4\u56de<\/p>\n<p>\u2463 epoll\u76d1\u542cET\u4e8b\u4ef6\u65f6&#xff0c;fd\u5fc5\u987b\u662f\u975e\u963b\u585e\u5957\u63a5\u53e3\u3002 \u6bd4\u5982\u76d1\u542c\u53ef\u8bfb\u4e8b\u4ef6&#xff0c;\u5f53ET\u4e0a\u62a5\u53ef\u8bfb\u540e&#xff0c;\u9700\u8981\u4e00\u76f4\u8bfbfd\u76f4\u5230\u9047\u5230EAGAIN\u9519\u8bef\u4e3a\u6b62&#xff0c;\u4ee5\u514d\u9057\u7559\u6570\u636e\u5728\u7f13\u51b2\u533a\u4e2d\u3002 \u5982\u679cfd\u662f\u963b\u585e\u7684&#xff0c;\u5219\u4f1a\u8bfb\u5230\u963b\u585e\u4e86\u3002 EAGAIN\u9519\u8bef\u5bf9\u4e8e\u975e\u963b\u585e\u5957\u63a5\u53e3\u6765\u8bf4\u4e0d\u662f\u9519\u8bef&#xff0c;\u53ea\u662f\u8bf4\u6ca1\u6709\u6570\u636e\u53ef\u8bfb\u6216\u8005\u6ca1\u6709\u7a7a\u95f4\u53ef\u5199\u3002 EWOULDBLOCK\u5c31\u662fEAGAIN&#xff0c;\u503c\u90fd\u662f11\u3002 selset\/poll\/epoll\u7684LT\u6a21\u5f0f\u76d1\u542c\u7684fd\u53ef\u4ee5\u662f\u963b\u585e\u6a21\u5f0f\u7684\u3002<\/p>\n<p>\u2464 \u591a\u8def\u590d\u7528\u76d1\u542cio\u4e8b\u4ef6\u65f6&#xff0c;\u5982\u679c\u5bf9\u67d0\u4e2a\u5957\u63a5\u53e3\u76d1\u542c\u53ef\u5199\u4e8b\u4ef6&#xff0c;\u603b\u662f\u4f1a\u8fd4\u56de\u53ef\u5199\u800c\u4e8b\u5b9e\u4e0a\u53ef\u80fd\u6ca1\u6709\u6570\u636e\u8981\u5199\u3002 \u5904\u7406\u65b9\u6cd5&#xff1a; \u2460\u53ea\u6709\u5728\u6709\u6570\u636e\u8981\u5199\u65f6\u624d\u628a\u8981\u5199\u7684\u5957\u63a5\u53e3\u52a0\u5165 \u76d1\u542c\u5217\u8868\u4e2d&#xff0c;\u6570\u636e\u5168\u90e8\u5199\u5b8c\u4e4b\u540e\u4ece\u76d1\u542c\u5217\u8868\u4e2d\u5220\u9664\u5b83&#xff1b; \u2461\u5728\u6709\u6570\u636e\u5199\u65f6&#xff0c;\u9996\u5148\u5c1d\u8bd5\u76f4\u63a5\u5199&#xff0c;\u5f53\u76f4\u63a5\u5199\u6ca1\u6709\u628a\u6570\u636e\u5168\u90e8\u5199\u5165\u53d1\u9001\u7f13\u51b2\u533a\u65f6\u518d\u628a\u8fd9\u4e2a\u5957\u63a5\u53e3\u52a0\u5165\u53ef\u5199\u4e8b\u4ef6 \u76d1\u542c\u5217\u8868\u3002 &#xff08;\u8fd9\u79cd\u65b9\u5f0f\u6548\u7387\u8f83\u9ad8&#xff0c;\u9700\u8981\u5957\u63a5\u53e3\u662f\u975e\u963b\u585e\u7684&#xff0c;\u524d\u4e00\u79cd\u65b9\u5f0f\u53ef\u4ee5\u662f\u963b\u585e\u7684\u5417&#xff1f;&#xff09; \u53ef\u4ee5\u662f\u963b\u585e\u7684\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"3051\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418155231-6802753fa33ec.png\" width=\"860\" \/><\/p>\n<h2>\u56db. \u7279\u70b9\u548c\u533a\u522b<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"424\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418155233-6802754118788.png\" width=\"726\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb973\u6b21\uff0c\u70b9\u8d5e32\u6b21\uff0c\u6536\u85cf25\u6b21\u3002select \u7684\u8c03\u7528\u6ce8\u610f\u4e8b\u9879\u5728\u4f7f\u7528 select \u51fd\u6570\u65f6\uff0c\u9700\u8981\u6ce8\u610f\u4ee5\u4e0b\u51e0\u4e2a\u5173\u952e\u70b9\uff1a1. \u53c2\u6570\u7684\u4fee\u6539\u4e0e\u62f7\u8d1dreadfds \u7b49\u53c2\u6570\u662f\u7ed3\u679c\u53c2\u6570 \uff1aselect \u51fd\u6570\u4f1a\u76f4\u63a5\u4fee\u6539\u4f20\u5165\u7684 fd_set\uff08\u5982 readfds\u3001writefds \u548c exceptfds\uff09\u3002\u4e3a\u4e86\u4fdd\u7559\u539f\u59cb\u76d1\u542c\u96c6\u5408\uff0c\u901a\u5e38\u4f1a\u5b9a\u4e49\u4e00\u4e2a\u5907\u4efd\u96c6\u5408\uff08\u5982 allread_fdset\uff09\uff0c\u5e76\u5c06\u5b83\u7684\u62f7\u8d1d\u4f20\u9012\u7ed9 select\u3002<\/p>\n","protected":false},"author":2,"featured_media":17385,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[768,100,43],"topic":[],"class_list":["post-17391","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-sql","tag-100","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>IO\u591a\u8def\u590d\u7528\u5b9e\u73b0\u5e76\u53d1\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/17391.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"IO\u591a\u8def\u590d\u7528\u5b9e\u73b0\u5e76\u53d1\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb973\u6b21\uff0c\u70b9\u8d5e32\u6b21\uff0c\u6536\u85cf25\u6b21\u3002select \u7684\u8c03\u7528\u6ce8\u610f\u4e8b\u9879\u5728\u4f7f\u7528 select \u51fd\u6570\u65f6\uff0c\u9700\u8981\u6ce8\u610f\u4ee5\u4e0b\u51e0\u4e2a\u5173\u952e\u70b9\uff1a1. \u53c2\u6570\u7684\u4fee\u6539\u4e0e\u62f7\u8d1dreadfds \u7b49\u53c2\u6570\u662f\u7ed3\u679c\u53c2\u6570 \uff1aselect \u51fd\u6570\u4f1a\u76f4\u63a5\u4fee\u6539\u4f20\u5165\u7684 fd_set\uff08\u5982 readfds\u3001writefds \u548c exceptfds\uff09\u3002\u4e3a\u4e86\u4fdd\u7559\u539f\u59cb\u76d1\u542c\u96c6\u5408\uff0c\u901a\u5e38\u4f1a\u5b9a\u4e49\u4e00\u4e2a\u5907\u4efd\u96c6\u5408\uff08\u5982 allread_fdset\uff09\uff0c\u5e76\u5c06\u5b83\u7684\u62f7\u8d1d\u4f20\u9012\u7ed9 select\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/17391.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T15:52:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418155230-6802753edf06e.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/17391.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/17391.html\",\"name\":\"IO\u591a\u8def\u590d\u7528\u5b9e\u73b0\u5e76\u53d1\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T15:52:34+00:00\",\"dateModified\":\"2025-04-18T15:52:34+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/17391.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/17391.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/17391.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"IO\u591a\u8def\u590d\u7528\u5b9e\u73b0\u5e76\u53d1\u670d\u52a1\u5668\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"IO\u591a\u8def\u590d\u7528\u5b9e\u73b0\u5e76\u53d1\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/17391.html","og_locale":"zh_CN","og_type":"article","og_title":"IO\u591a\u8def\u590d\u7528\u5b9e\u73b0\u5e76\u53d1\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb973\u6b21\uff0c\u70b9\u8d5e32\u6b21\uff0c\u6536\u85cf25\u6b21\u3002select \u7684\u8c03\u7528\u6ce8\u610f\u4e8b\u9879\u5728\u4f7f\u7528 select \u51fd\u6570\u65f6\uff0c\u9700\u8981\u6ce8\u610f\u4ee5\u4e0b\u51e0\u4e2a\u5173\u952e\u70b9\uff1a1. \u53c2\u6570\u7684\u4fee\u6539\u4e0e\u62f7\u8d1dreadfds \u7b49\u53c2\u6570\u662f\u7ed3\u679c\u53c2\u6570 \uff1aselect \u51fd\u6570\u4f1a\u76f4\u63a5\u4fee\u6539\u4f20\u5165\u7684 fd_set\uff08\u5982 readfds\u3001writefds \u548c exceptfds\uff09\u3002\u4e3a\u4e86\u4fdd\u7559\u539f\u59cb\u76d1\u542c\u96c6\u5408\uff0c\u901a\u5e38\u4f1a\u5b9a\u4e49\u4e00\u4e2a\u5907\u4efd\u96c6\u5408\uff08\u5982 allread_fdset\uff09\uff0c\u5e76\u5c06\u5b83\u7684\u62f7\u8d1d\u4f20\u9012\u7ed9 select\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/17391.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T15:52:34+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418155230-6802753edf06e.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/17391.html","url":"https:\/\/www.wsisp.com\/helps\/17391.html","name":"IO\u591a\u8def\u590d\u7528\u5b9e\u73b0\u5e76\u53d1\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T15:52:34+00:00","dateModified":"2025-04-18T15:52:34+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/17391.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/17391.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/17391.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"IO\u591a\u8def\u590d\u7528\u5b9e\u73b0\u5e76\u53d1\u670d\u52a1\u5668"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/17391","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=17391"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/17391\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/17385"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=17391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=17391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=17391"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=17391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}