{"id":296,"date":"2011-12-15T14:33:56","date_gmt":"2011-12-15T06:33:56","guid":{"rendered":"http:\/\/ykyi.net\/?p=296"},"modified":"2011-12-15T14:33:56","modified_gmt":"2011-12-15T06:33:56","slug":"unix%e7%bd%91%e7%bb%9c%e7%bc%96%e7%a8%8b-%e7%ac%ac%e4%b8%83%e7%ab%a0%e7%ac%94%e8%ae%b0","status":"publish","type":"post","link":"https:\/\/ykyi.net\/?p=296","title":{"rendered":"Unix\u7f51\u7edc\u7f16\u7a0b.\u7b2c\u4e03\u7ae0\u7b14\u8bb0"},"content":{"rendered":"<div>1.&nbsp;\u6709\u4e00\u4e2a&nbsp;<span style=\"font-family: Times New Roman;\">Generic&nbsp;Socket&nbsp;Option<\/span><span style=\"font-family: \u5b8b\u4f53;\">\uff1a<\/span><span style=\"font-family: Times New Roman;\">SO_BROADCAST&nbsp;<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u7528\u6765\u5f00\u542f\u662f\u5426\u5145\u8bb8\u5e7f\u64ad\u3002<\/span>2.&nbsp;\u4ec5\u6709<span style=\"font-family: Times New Roman;\">TCP<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u652f\u6301<\/span><span style=\"font-family: Times New Roman;\">SO_DEBUG<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u3002<\/span><span style=\"font-family: Times New Roman;\">Kernel<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u628a\u8be6\u7ec6\u7684\u53d1\u9001\u5305\u7684\u63a5\u6536\u5305\u4fe1\u606f\u5b58\u5728\u4e00\u4e2a\u73af\u8def<\/span><span style=\"font-family: Times New Roman;\">buffer<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u91cc\u3002\u53ef\u4ee5\u7528<\/span><span style=\"font-family: Times New Roman;\">trpt<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u67e5\u770b\u5b83\u3002<\/span>3.&nbsp;SO_ERROR<span style=\"font-family: \u5b8b\u4f53;\">\u5957\u63a5\u5b57\u9009\u9879\u53ea\u80fd\u88ab\u53d6\u5f97\uff0c\u4e0d\u80fd\u88ab\u8bbe\u7f6e\u3002\u5982\u679c\u8fdb\u7a0b\u963b\u585e\u5728<\/span><span style=\"font-family: Times New Roman;\">select<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u8c03\u7528\u91cc\uff0c\u4e0d\u8bba\u662f\u8bfb\u8fd8\u662f\u5199\uff0c<\/span><span style=\"font-family: Times New Roman;\">select<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u90fd\u4f1a\u8fd4\u56de<\/span><span style=\"font-family: Times New Roman;\">conditions&nbsp;set<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u3002\u5982\u679c\u8fdb\u7a0b\u4f7f\u7528<\/span><span style=\"font-family: Times New Roman;\">signal-driven&nbsp;I\/O<\/span><span style=\"font-family: \u5b8b\u4f53;\">\uff0c\u5219<\/span><span style=\"font-family: Times New Roman;\">SIGIO<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u4fe1\u53f7\u4f1a\u88ab\u53d1\u5230\u8fd9\u4e2a\u8fdb\u7a0b\u6216\u8005\u5b83\u6240\u5728\u7684\u8fdb\u7a0b\u7ec4\u3002\u8fdb\u7a0b\u7528<\/span><span style=\"font-family: Times New Roman;\">getsockopt<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u5f97\u5230<\/span><span style=\"font-family: Times New Roman;\">so_error<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u540e\uff0c<\/span><span style=\"font-family: Times New Roman;\">so_error<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u5c31\u4f1a\u88ab\u91cd\u7f6e\u4e3a<\/span><span style=\"font-family: Times New Roman;\">0.<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u5982\u679c<\/span><span style=\"font-family: Times New Roman;\">so_error<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u4e0d\u4e3a<\/span><span style=\"font-family: Times New Roman;\">0<\/span><span style=\"font-family: \u5b8b\u4f53;\">\uff0c\u6b64\u65f6\u8c03\u7528&nbsp;<\/span><span style=\"font-family: Times New Roman;\">read&nbsp;<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u6216\u8005&nbsp;<\/span><span style=\"font-family: Times New Roman;\">write&nbsp;<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u5c31\u4f1a\u7acb\u5373\u8fd4\u56de<\/span><span style=\"font-family: Times New Roman;\">-1<\/span><span style=\"font-family: \u5b8b\u4f53;\">\uff0c<\/span><span style=\"font-family: Times New Roman;\">errno<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u88ab\u7f6e\u4e3a<\/span><span style=\"font-family: Times New Roman;\">so_error<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u7684\u503c\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>4.&nbsp;SO_KEEPALIVE<span style=\"font-family: \u5b8b\u4f53;\">\u5728\u4e00\u4e2a<\/span><span style=\"font-family: Times New Roman;\">tcp<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u8fde\u63a5\u6ca1\u6709\u4efb\u4f55\u6536\u53d1\u8fbe\u4e24\u4e2a\u5c0f\u65f6\u65f6\u4f1a\u53d1\u4e00\u4e2a<\/span><span style=\"font-family: Times New Roman;\">prob<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u7ed9\u5bf9\u65b9\u3002\u4e24\u4e2a\u949f\u5594\u3002\u597d\u957f\u7684\u65f6\u95f4\u554a\uff01\uff01\uff01<\/span><span style=\"font-family: Times New Roman;\">Richard&nbsp;Stevens<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u8ba4\u4e3a<\/span><span style=\"font-family: Times New Roman;\">SO_KEEPALIVE<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u5e94\u8be5\u6539\u53eb&nbsp;<\/span><span style=\"font-family: Times New Roman;\">make-dead<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u3002\u5927\u591a<\/span><span style=\"font-family: Times New Roman;\">Unix<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u7684<\/span><span style=\"font-family: Times New Roman;\">kernel<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u628a\u8fd9\u4e2a\u4e24\u5c0f\u65f6\u65f6\u957f\u5b58\u4e3a\u4e00\u4e2a\u7cfb\u7edf\u7ea7\u7684\u53d8\u91cf\u3002\u8fd9\u610f\u5473\u7740\u5982\u679c\u4f60\u7528\u67d0\u79cd\u65b9\u6cd5\u6539\u53d8\u4e86\u8fd9\u4e2a\u65f6\u957f\uff0c\u4f1a\u5f71\u54cd\u8fd9\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u7684\u6240\u6709<\/span><span style=\"font-family: Times New Roman;\">socket.Richard&nbsp;Stevens<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u8ba4\u4e3a\u60f3\u628a\u8fd9\u4e2a\u65f6\u957f\u6539\u77ed\u7684\u60f3\u6cd5\u662f\u9519\u8bef\u7406\u89e3\u4e86\u8fd9\u4e2a\u9009\u9879\u7684\u610f\u4e49\u3002<\/span><\/p>\n<p>5.&nbsp;SO_LINGER<span style=\"font-family: \u5b8b\u4f53;\">\u4ec5\u4ec5\u9002\u7528\u4e8e\u9762\u5411\u8fde\u63a5\u7684<\/span><span style=\"font-family: Times New Roman;\">socket<\/span><span style=\"font-family: \u5b8b\u4f53;\">\uff0c\u6bd4\u5982<\/span><span style=\"font-family: Times New Roman;\">TCP<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u548c<\/span><span style=\"font-family: Times New Roman;\">SCTP<\/span><span style=\"font-family: \u5b8b\u4f53;\">\uff0c\u56e0\u6b64\u4e0d\u9002\u7528<\/span><span style=\"font-family: Times New Roman;\">UDP<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u3002<\/span><\/p>\n<p>Struct&nbsp;linger{<\/p>\n<p>int&nbsp;l_onofff;<\/p>\n<p>int&nbsp;l_linger;<\/p>\n<p>};<\/p>\n<p>L_onoff<span style=\"font-family: \u5b8b\u4f53;\">\u4e3a\u96f6\u662f\uff0c<\/span><span style=\"font-family: Times New Roman;\">close<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u7684<\/span><span style=\"font-family: Times New Roman;\">behavior<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u5c31\u662f\u9ed8\u8ba4\u60c5\u51b5\uff1a<\/span><span style=\"font-family: Times New Roman;\">close<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u7acb\u5373\u8fd4\u56de\uff0c<\/span><span style=\"font-family: Times New Roman;\">kernel<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u7ee7\u7eed\u53d1\u9001\u7f13\u51b2\u533a\u5185\u672a\u53d1\u9001\u7684\u6570\u636e\u3002\u5f53<\/span><span style=\"font-family: Times New Roman;\">l_onoff<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u4e0d\u4e3a\u96f6\uff0c\u800c<\/span><span style=\"font-family: Times New Roman;\">l_linger<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u4e3a<\/span><span style=\"font-family: Times New Roman;\">0<\/span><span style=\"font-family: \u5b8b\u4f53;\">\uff0c<\/span><span style=\"font-family: Times New Roman;\">TCP<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u534f\u8bae\u5219\u4f1a\u7acb\u5373\u7ec8\u6b62\u8fde\u63a5\uff0c\u53d1\u9001<\/span><span style=\"font-family: Times New Roman;\">RST<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u7ed9<\/span><span style=\"font-family: Times New Roman;\">peer<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u7aef\uff0c\u8fd9\u6837\u505a\u907f\u514d\u4e86<\/span><span style=\"font-family: Times New Roman;\">TCP<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u7684<\/span><span style=\"font-family: Times New Roman;\">TIME_WAIT<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u72b6\u6001\uff0c\u8fd9\u6837\u7684\u574f\u5904\u662f<\/span><span style=\"font-family: Times New Roman;\">:&nbsp;leaves&nbsp;open&nbsp;the&nbsp;possibility&nbsp;of&nbsp;another&nbsp;incarnation&nbsp;of&nbsp;this&nbsp;connection&nbsp;being&nbsp;created&nbsp;within&nbsp;2MSL&nbsp;seconds&nbsp;and&nbsp;having&nbsp;old&nbsp;duplicate&nbsp;segments&nbsp;from&nbsp;the&nbsp;just-terminated&nbsp;connection&nbsp;being&nbsp;incorrectly&nbsp;delivered&nbsp;to&nbsp;the&nbsp;new&nbsp;incarnation.<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u5bf9\u4e8e<\/span><span style=\"font-family: Times New Roman;\">SCTP,&nbsp;<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u4e5f\u4f1a\u53d1\u9001\u4e00\u4e2a<\/span><span style=\"font-family: Times New Roman;\">ABORT&nbsp;chunk<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u7ed9<\/span><span style=\"font-family: Times New Roman;\">peer.<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u7b2c\u4e09\u79cd\u60c5\u51b5\uff1a\u5982\u679c<\/span><span style=\"font-family: Times New Roman;\">l_onoff<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u4e3a\u771f\uff0c<\/span><span style=\"font-family: Times New Roman;\">l_linger<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u4e0d\u4e3a<\/span><span style=\"font-family: Times New Roman;\">0.<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u5219<\/span><span style=\"font-family: Times New Roman;\">close<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u4e0d\u4f1a\u7acb\u5373\u8fd4\u56de\uff0c\u4f1a\u6700\u591a\u7b49\u5f85\u6307\u5b9a\u7684\u65f6\u957f\uff0c\u5728\u8fd9\u6bb5\u65f6\u95f4\u91cc<\/span><span style=\"font-family: Times New Roman;\">kernel<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u53d1\u9001\u7f13\u51b2\u533a\u5185\u7684\u6570\u636e\u7ed9<\/span><span style=\"font-family: Times New Roman;\">peer<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u3002\u5982\u679c\u5728\u8fd9\u6bb5\u65f6\u95f4\u5185\u53d1\u9001\u5b8c\u5219<\/span><span style=\"font-family: Times New Roman;\">close<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u8fd4\u56de<\/span><span style=\"font-family: Times New Roman;\">0.<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u5982\u679c\u6ca1\u6709\u53d1\u9001\u5b8c\u6bd5\uff0c<\/span><span style=\"font-family: Times New Roman;\">close<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u5c31\u4f1a\u8fd4\u56de<\/span><span style=\"font-family: Times New Roman;\">EWOULDBLOCK<\/span><span style=\"font-family: \u5b8b\u4f53;\">\uff0c<\/span><span style=\"font-family: Times New Roman;\">send&nbsp;buffer<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u91cc\u7684\u6570\u636e\u4f1a\u88ab\u4e22\u5f03\u3002<\/span><\/p>\n<p>6.&nbsp;MSL:&nbsp;maximum&nbsp;segment&nbsp;lifetime.<\/p>\n<p>7.&nbsp;\u56e0\u6b64<span style=\"font-family: Times New Roman;\">close<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u7acb\u5373\u8fd4\u56de\uff0c\u5373\u4f7f\u7528<\/span><span style=\"font-family: Times New Roman;\">SO_LINGER<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u8bbe\u7f6e\u7b49\u5f85\u65f6\u95f4\u4e5f\u5728\u7406\u8bba\u4e0a\u5b58\u5728<\/span><span style=\"font-family: Times New Roman;\">close<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u5148\u4e8e\u53d1\u9001\u7f13\u51b2\u533a\u7684\u6570\u636e\u88ab<\/span><span style=\"font-family: Times New Roman;\">peer<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u7aef<\/span><span style=\"font-family: Times New Roman;\">acknowleded<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u7684\u60c5\u51b5\u3002\u56e0\u6b64\u4e00\u4e2a\u66f4\u597d\u7684\u89e3\u51b3\u65b9\u6848\u662f\u7528<\/span><span style=\"font-family: Times New Roman;\">shutdown<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u7cfb\u7edf\u8c03\u7528<\/span><span style=\"font-family: Times New Roman;\">with&nbsp;a&nbsp;second&nbsp;argument&nbsp;of&nbsp;SHUT_WR<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u3002\u5728\u8c03\u7528<\/span><span style=\"font-family: Times New Roman;\">shutdown<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u540e\uff0c\u7528<\/span><span style=\"font-family: Times New Roman;\">read<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u8c03\u7528\u76f4\u5230<\/span><span style=\"font-family: Times New Roman;\">read<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u8fd4\u56de<\/span><span style=\"font-family: Times New Roman;\">0<\/span><span style=\"font-family: \u5b8b\u4f53;\">\uff0c\u5373\u6536\u5230<\/span><span style=\"font-family: Times New Roman;\">peer<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u7aef\u7684<\/span><span style=\"font-family: Times New Roman;\">FIN<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u3002<\/span><\/p>\n<p>8.&nbsp;UDP<span style=\"font-family: \u5b8b\u4f53;\">\u6ca1\u6709<\/span><span style=\"font-family: Times New Roman;\">congestion&nbsp;control<\/span><span style=\"font-family: \u5b8b\u4f53;\">\uff0c\u5982\u679c\u53d1\u5f97\u592a\u5feb\uff0c\u4e0d\u4ec5\u4ec5<\/span><span style=\"font-family: Times New Roman;\">peer<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u7aef\u6765\u4e0d\u53ca\u6536\u3002<\/span><span style=\"font-family: Times New Roman;\">A&nbsp;fast&nbsp;sender&nbsp;can&nbsp;overwhelm&nbsp;its&nbsp;own&nbsp;network&nbsp;interface,&nbsp;causing&nbsp;datagrams&nbsp;to&nbsp;be&nbsp;discarded&nbsp;by&nbsp;the&nbsp;sender&nbsp;itself.<\/span><\/p>\n<p>9.&nbsp;\u56e0\u4e3a<span style=\"font-family: Times New Roman;\">tcp<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u5728\u4e09\u6b21\u63e1\u624b\u9636\u6bb5\u7684<\/span><span style=\"font-family: Times New Roman;\">SYN&nbsp;segment<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u91cc\u4ea4\u6362\u7a97\u53e3\u5927\u5c0f<\/span><span style=\"font-family: Times New Roman;\">(windows&nbsp;scale)<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u3002\u6240\u4ee5<\/span><span style=\"font-family: Times New Roman;\">tcp<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u7684\u63a5\u6536\u7f13\u51b2\u5927\u5c0f\u5fc5\u987b\u5728<\/span><span style=\"font-family: Times New Roman;\">shank&nbsp;hands<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u4e4b\u524d\u5c31\u8bbe\u7f6e\u597d\u3002<\/span><span style=\"font-family: Times New Roman;\">Connected&nbsp;socket<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u4ece<\/span><span style=\"font-family: Times New Roman;\">listening&nbsp;socket<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u7ee7\u627f\u8fd9\u4e2a\u9009\u9879\u3002<\/span><\/p>\n<p>10.&nbsp;TCP<span style=\"font-family: \u5b8b\u4f53;\">\u7684\u5957\u63a5\u5b57\u7f13\u51b2\u533a\u5927\u5c0f\u81f3\u5c11\u9700\u8981\u662f<\/span><span style=\"font-family: Times New Roman;\">4<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u500d<\/span><span style=\"font-family: Times New Roman;\">MSS<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u7684\u5927\u5c0f\u3002<\/span>\u8fd9\u91cc\u6307\u7684\u5957\u63a5\u5b57\u7f13\u51b2\uff0c\u5982\u679c\u662f\u9488\u5bf9\u5355\u5411\u7684\u4f20\u8f93\uff0c\u6bd4\u5982\u5355\u5411\u4f20\u4e00\u4e2a\u6587\u4ef6\uff0c\u6307\u7684\u662f\u53d1\u9001\u65b9\u7684\u53d1\u9001\u7f13\u51b2\u548c\u63a5\u6536\u65b9\u7684\u63a5\u6536\u7f13\u51b2\u3002\u5982\u679c\u662f\u53cc\u5411\u7684\u4f20\u8f93\uff0c\u5219\u6307\u7684\u662f\u53cc\u65b9\u7684\u63a5\u6536\u548c\u53d1\u9001\u7f13\u51b2\u3002\u4e3a\u4ec0\u4e48<span style=\"font-family: Times New Roman;\">tcp<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u5957\u63a5\u5b57\u7684\u7f13\u51b2\u533a\u9700\u8981\u81f3\u5c11&nbsp;&nbsp;&nbsp;\u662f<\/span><span style=\"font-family: Times New Roman;\">4<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u500d<\/span><span style=\"font-family: Times New Roman;\">MSS<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u7684\u5927\u5c0f\u5462\uff1f<\/span>\u8fd9\u662f\u56e0\u4e3a<span style=\"font-family: Times New Roman;\">tcp<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u7684\u5feb\u6062\u590d<\/span><span style=\"font-family: Times New Roman;\">(fast&nbsp;recovery)<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u7b97\u6cd5\u3002\u5feb\u6062\u590d\u7b97\u6cd5\u5b9a\u4e49\uff1a\u5982\u679c\u63a5\u6536\u7aef\u8fde\u7eed\u6536\u5230\u4e09\u4e2a\u540c\u6837\u7684<\/span><span style=\"font-family: Times New Roman;\">ACK<\/span><span style=\"font-family: \u5b8b\u4f53;\">\uff0c\u5c31\u8ba4\u4e3a\u6709<\/span><span style=\"font-family: Times New Roman;\">packet<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u4e22\u5931\u4e86\u3002\u800c\u63a5\u6536\u7aef\u5728<\/span><span style=\"font-family: Times New Roman;\">segment<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u4e22\u5931\u540e\uff0c\u6bcf\u6536\u5230\u65b0\u7684<\/span><span style=\"font-family: Times New Roman;\">segment<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u5c31\u4e0d\u505c\u5730\u91cd\u53d1\u4e00\u4e2a\u91cd\u590d\u7684<\/span><span style=\"font-family: Times New Roman;\">ack<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u7ed9<\/span><span style=\"font-family: Times New Roman;\">sender<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u3002\u5982\u679c\u7a97\u53e3\u5927\u5c0f\u5c0f\u4e8e<\/span><span style=\"font-family: Times New Roman;\">4<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u4e2a<\/span><span style=\"font-family: Times New Roman;\">segments,<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u5c31\u4e0d\u4f1a\u6709\u4e09\u4e2a\u91cd\u590d\u7684<\/span><span style=\"font-family: Times New Roman;\">ACK,<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u6240\u4ee5\u5feb\u6062\u590d\u7b97\u6cd5\u5c31\u6ca1\u529e\u6cd5\u5de5\u4f5c\u4e86\u3002<\/span><\/p>\n<p>11.&nbsp;What&nbsp;is&nbsp;bandwidth-delay&nbsp;product.<\/p>\n<p>A:&nbsp;The&nbsp;capacity&nbsp;of&nbsp;the&nbsp;pipe&nbsp;is&nbsp;called&nbsp;the&nbsp;bandwidth-delay&nbsp;product&nbsp;and&nbsp;we&nbsp;calculate&nbsp;this&nbsp;by&nbsp;multiplying&nbsp;the&nbsp;bandwidth(in&nbsp;bits\/sec)&nbsp;times&nbsp;the&nbsp;RTT(in&nbsp;seconds),&nbsp;converting&nbsp;the&nbsp;result&nbsp;from&nbsp;bits&nbsp;to&nbsp;bytes.&nbsp;<span style=\"font-family: \u5b8b\u4f53;\">\u5373\u7f51\u901f\u4e58\u4e0a<\/span><span style=\"font-family: Times New Roman;\">RTT.<\/span><\/p>\n<p>12.&nbsp;UDP<span style=\"font-family: \u5b8b\u4f53;\">\u6ca1\u6709<\/span><span style=\"font-family: Times New Roman;\">send&nbsp;buffer<\/span><span style=\"font-family: \u5b8b\u4f53;\">\uff0c\u4f46\u6709\u4e00\u4e2a<\/span><span style=\"font-family: Times New Roman;\">send&nbsp;buffer&nbsp;size.<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u53ea\u8981<\/span><span style=\"font-family: Times New Roman;\">socket<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u7684<\/span><span style=\"font-family: Times New Roman;\">buffer&nbsp;size<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u5927\u4e8e<\/span><span style=\"font-family: Times New Roman;\">LO_WATER<\/span><span style=\"font-family: \u5b8b\u4f53;\">\uff0c\u5c31\u6c38\u8fdc\u662f\u53ef\u5199\u7684\u3002<\/span><\/p>\n<p>13.&nbsp;SO_REUSEADDR<span style=\"font-family: \u5b8b\u4f53;\">\u6709\u56db\u79cd\u7528\u9014\u3002\u597d\u96be\u5199\u3002\u89c1<\/span><span style=\"font-family: Times New Roman;\">Unix&nbsp;Network&nbsp;Programming&nbsp;Section&nbsp;7.5&nbsp;<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u5f71\u5370\u7248\u7b2c<\/span><span style=\"font-family: Times New Roman;\">211<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u9875\u5566\u3002<\/span><\/p>\n<p>14.&nbsp;It&#39;s&nbsp;Ok&nbsp;for&nbsp;the&nbsp;MSS&nbsp;to&nbsp;be&nbsp;different&nbsp;in&nbsp;each&nbsp;direction.<\/p>\n<p>15.&nbsp;Nagle<span style=\"font-family: \u5b8b\u4f53;\">\u7b97\u6cd5\u662f\u4e3a\u4e86\u51cf\u5c11<\/span><span style=\"font-family: Times New Roman;\">small&nbsp;package<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u7684\u6570\u91cf.<\/span><span style=\"font-family: Times New Roman;\">The&nbsp;algorithm&nbsp;states&nbsp;that&nbsp;if&nbsp;a&nbsp;given&nbsp;connection&nbsp;has&nbsp;outstanding&nbsp;data,&nbsp;then&nbsp;no&nbsp;small&nbsp;packets&nbsp;will&nbsp;be&nbsp;sent&nbsp;on&nbsp;the&nbsp;connection&nbsp;in&nbsp;response&nbsp;to&nbsp;a&nbsp;user&nbsp;write&nbsp;operation&nbsp;until&nbsp;the&nbsp;existing&nbsp;data&nbsp;is&nbsp;acknowledged.&nbsp;Small&nbsp;package&nbsp;<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u6307\u7684\u662f\u4efb\u4f55\u6bd4<\/span><span style=\"font-family: Times New Roman;\">MSS<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u5c0f\u7684<\/span><span style=\"font-family: Times New Roman;\">package.<\/span><\/p>\n<p>16.&nbsp;Delayed&nbsp;ACK&nbsp;algorithm:&nbsp;This&nbsp;algorithm&nbsp;causes&nbsp;TCP&nbsp;to&nbsp;not&nbsp;send&nbsp;an&nbsp;ACK&nbsp;immediately&nbsp;when&nbsp;it&nbsp;receives&nbsp;data;&nbsp;instead,&nbsp;TCP&nbsp;will&nbsp;wait&nbsp;some&nbsp;small&nbsp;amount&nbsp;of&nbsp;time&nbsp;(typically&nbsp;50-200ms)and&nbsp;only&nbsp;then&nbsp;send&nbsp;the&nbsp;ACK.<\/p>\n<p>17.&nbsp;SCTP<span style=\"font-family: \u5b8b\u4f53;\">\u6709\u4e00\u4e2a<\/span><span style=\"font-family: Times New Roman;\">SCTP_AUTOCLOSE<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u5957\u63a5\u5b57\u9009\u9879\u3002<\/span><span style=\"font-family: Times New Roman;\">This&nbsp;option&nbsp;allows&nbsp;us&nbsp;to&nbsp;fetch&nbsp;or&nbsp;set&nbsp;the&nbsp;autoclose&nbsp;time&nbsp;for&nbsp;an&nbsp;SCTP&nbsp;endpoint.&nbsp;The&nbsp;autoclose&nbsp;time&nbsp;is&nbsp;the&nbsp;number&nbsp;of&nbsp;seconds&nbsp;an&nbsp;SCTP&nbsp;association&nbsp;will&nbsp;remain&nbsp;open&nbsp;when&nbsp;idle.<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u5373<\/span><span style=\"font-family: Times New Roman;\">SCTP&nbsp;association<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u80fd\u591f\u4fdd\u6301\u7a7a\u95f2\u72b6\u6001\u7684\u6700\u957f\u65f6\u95f4\u3002\u8d85\u65f6\u5c31\u4f1a\u88ab\u5173\u95ed\u3002<\/span><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>1.&nbsp;\u6709\u4e00\u4e2a&nbsp;Generic&nbsp;Socket&nbsp;Option\uff1aSO_BROADCAST&nbsp;\u7528\u6765\u5f00\u542f\u662f\u5426\u5145\u8bb8\u5e7f\u64ad\u30022.&nbsp;\u4ec5\u6709TCP\u652f\u6301SO_DEBUG\u3002Kernel\u628a\u8be6\u7ec6\u7684\u53d1\u9001\u5305\u7684\u63a5\u6536\u5305\u4fe1\u606f\u5b58\u5728\u4e00\u4e2a\u73af\u8defbuffer\u91cc\u3002\u53ef\u4ee5\u7528trpt\u67e5\u770b\u5b83\u30023.&nbsp;SO_ERROR\u5957\u63a5\u5b57\u9009\u9879\u53ea\u80fd\u88ab\u53d6\u5f97\uff0c\u4e0d\u80fd\u88ab\u8bbe\u7f6e\u3002\u5982\u679c\u8fdb\u7a0b\u963b\u585e\u5728select\u8c03\u7528\u91cc\uff0c\u4e0d\u8bba\u662f\u8bfb\u8fd8\u662f\u5199\uff0cselect\u90fd\u4f1a\u8fd4\u56deconditions&nbsp;set\u3002\u5982\u679c\u8fdb\u7a0b\u4f7f\u7528signal-driven&nbsp;I\/O\uff0c\u5219SIGIO\u4fe1\u53f7\u4f1a\u88ab\u53d1\u5230\u8fd9\u4e2a\u8fdb\u7a0b\u6216\u8005\u5b83\u6240\u5728\u7684\u8fdb\u7a0b\u7ec4\u3002\u8fdb\u7a0b\u7528getsockopt\u5f97\u5230so_error\u540e\uff0cso_error\u5c31\u4f1a\u88ab\u91cd\u7f6e\u4e3a0.\u5982\u679cso_error\u4e0d\u4e3a0\uff0c\u6b64\u65f6\u8c03\u7528&nbsp;read&nbsp;\u6216\u8005&nbsp;write&nbsp;\u5c31\u4f1a\u7acb\u5373\u8fd4\u56de-1\uff0cerrno\u88ab\u7f6e\u4e3aso_error\u7684\u503c\u3002 &nbsp; &nbsp; 4.&nbsp;SO_KEEPALIVE\u5728\u4e00\u4e2atcp\u8fde\u63a5\u6ca1\u6709\u4efb\u4f55\u6536\u53d1\u8fbe\u4e24\u4e2a\u5c0f\u65f6\u65f6\u4f1a\u53d1\u4e00\u4e2aprob\u7ed9\u5bf9\u65b9\u3002\u4e24\u4e2a\u949f\u5594\u3002\u597d\u957f\u7684\u65f6\u95f4\u554a\uff01\uff01\uff01Richard&nbsp;Stevens\u8ba4\u4e3aSO_KEEPALIVE\u5e94\u8be5\u6539\u53eb&nbsp;make-dead\u3002\u5927\u591aUnix\u7684kernel\u628a\u8fd9\u4e2a\u4e24\u5c0f\u65f6\u65f6\u957f\u5b58\u4e3a\u4e00\u4e2a\u7cfb\u7edf\u7ea7\u7684\u53d8\u91cf\u3002\u8fd9\u610f\u5473\u7740\u5982\u679c\u4f60\u7528\u67d0\u79cd\u65b9\u6cd5\u6539\u53d8\u4e86\u8fd9\u4e2a\u65f6\u957f\uff0c\u4f1a\u5f71\u54cd\u8fd9\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u7684\u6240\u6709socket.Richard&nbsp;Stevens\u8ba4\u4e3a\u60f3\u628a\u8fd9\u4e2a\u65f6\u957f\u6539\u77ed\u7684\u60f3\u6cd5\u662f\u9519\u8bef\u7406\u89e3\u4e86\u8fd9\u4e2a\u9009\u9879\u7684\u610f\u4e49\u3002 5.&nbsp;SO_LINGER\u4ec5\u4ec5\u9002\u7528\u4e8e\u9762\u5411\u8fde\u63a5\u7684socket\uff0c\u6bd4\u5982TCP\u548cSCTP\uff0c\u56e0\u6b64\u4e0d\u9002\u7528UDP\u3002 Struct&nbsp;linger{ int&nbsp;l_onofff; int&nbsp;l_linger; }; L_onoff\u4e3a\u96f6\u662f\uff0cclose\u7684behavior\u5c31\u662f\u9ed8\u8ba4\u60c5\u51b5\uff1aclose\u7acb\u5373\u8fd4\u56de\uff0ckernel\u7ee7\u7eed\u53d1\u9001\u7f13\u51b2\u533a\u5185\u672a\u53d1\u9001\u7684\u6570\u636e\u3002\u5f53l_onoff\u4e0d\u4e3a\u96f6\uff0c\u800cl_linger\u4e3a0\uff0cTCP\u534f\u8bae\u5219\u4f1a\u7acb\u5373\u7ec8\u6b62\u8fde\u63a5\uff0c\u53d1\u9001RST\u7ed9peer\u7aef\uff0c\u8fd9\u6837\u505a\u907f\u514d\u4e86TCP\u7684TIME_WAIT\u72b6\u6001\uff0c\u8fd9\u6837\u7684\u574f\u5904\u662f:&nbsp;leaves&nbsp;open&nbsp;the&nbsp;possibility&nbsp;of&nbsp;another&nbsp;incarnation&nbsp;of&nbsp;this&nbsp;connection&nbsp;being&nbsp;created&nbsp;within&nbsp;2MSL&nbsp;seconds&nbsp;and&nbsp;having&nbsp;old&nbsp;duplicate&nbsp;segments&nbsp;from&nbsp;the&nbsp;just-terminated&nbsp;connection&nbsp;being&nbsp;incorrectly&nbsp;delivered&nbsp;to&nbsp;the&nbsp;new&nbsp;incarnation.\u5bf9\u4e8eSCTP,&nbsp;\u4e5f\u4f1a\u53d1\u9001\u4e00\u4e2aABORT&nbsp;chunk\u7ed9peer.\u7b2c\u4e09\u79cd\u60c5\u51b5\uff1a\u5982\u679cl_onoff\u4e3a\u771f\uff0cl_linger\u4e0d\u4e3a0.\u5219close\u4e0d\u4f1a\u7acb\u5373\u8fd4\u56de\uff0c\u4f1a\u6700\u591a\u7b49\u5f85\u6307\u5b9a\u7684\u65f6\u957f\uff0c\u5728\u8fd9\u6bb5\u65f6\u95f4\u91cckernel\u53d1\u9001\u7f13\u51b2\u533a\u5185\u7684\u6570\u636e\u7ed9peer\u3002\u5982\u679c\u5728\u8fd9\u6bb5\u65f6\u95f4\u5185\u53d1\u9001\u5b8c\u5219close\u8fd4\u56de0.\u5982\u679c\u6ca1\u6709\u53d1\u9001\u5b8c\u6bd5\uff0cclose\u5c31\u4f1a\u8fd4\u56deEWOULDBLOCK\uff0csend&nbsp;buffer\u91cc\u7684\u6570\u636e\u4f1a\u88ab\u4e22\u5f03\u3002 6.&nbsp;MSL:&nbsp;maximum&nbsp;segment&nbsp;lifetime. 7.&nbsp;\u56e0\u6b64close\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u7acb\u5373\u8fd4\u56de\uff0c\u5373\u4f7f\u7528SO_LINGER\u8bbe\u7f6e\u7b49\u5f85\u65f6\u95f4\u4e5f\u5728\u7406\u8bba\u4e0a\u5b58\u5728close\u5148\u4e8e\u53d1\u9001\u7f13\u51b2\u533a\u7684\u6570\u636e\u88abpeer\u7aefacknowleded\u7684\u60c5\u51b5\u3002\u56e0\u6b64\u4e00\u4e2a\u66f4\u597d\u7684\u89e3\u51b3\u65b9\u6848\u662f\u7528shutdown\u7cfb\u7edf\u8c03\u7528with&nbsp;a&nbsp;second&nbsp;argument&nbsp;of&nbsp;SHUT_WR\u3002\u5728\u8c03\u7528shutdown\u540e\uff0c\u7528read\u8c03\u7528\u76f4\u5230read\u8fd4\u56de0\uff0c\u5373\u6536\u5230peer\u7aef\u7684FIN\u3002 8.&nbsp;UDP\u6ca1\u6709congestion&nbsp;control\uff0c\u5982\u679c\u53d1\u5f97\u592a\u5feb\uff0c\u4e0d\u4ec5\u4ec5peer\u7aef\u6765\u4e0d\u53ca\u6536\u3002A&nbsp;fast&nbsp;sender&nbsp;can&nbsp;overwhelm&nbsp;its&nbsp;own&nbsp;network&nbsp;interface,&nbsp;causing&nbsp;datagrams&nbsp;to&nbsp;be&nbsp;discarded&nbsp;by&nbsp;the&nbsp;sender&nbsp;itself. 9.&nbsp;\u56e0\u4e3atcp\u5728\u4e09\u6b21\u63e1\u624b\u9636\u6bb5\u7684SYN&nbsp;segment\u91cc\u4ea4\u6362\u7a97\u53e3\u5927\u5c0f(windows&nbsp;scale)\u3002\u6240\u4ee5tcp\u7684\u63a5\u6536\u7f13\u51b2\u5927\u5c0f\u5fc5\u987b\u5728shank&nbsp;hands\u4e4b\u524d\u5c31\u8bbe\u7f6e\u597d\u3002Connected&nbsp;socket\u4ecelistening&nbsp;socket\u7ee7\u627f\u8fd9\u4e2a\u9009\u9879\u3002 10.&nbsp;TCP\u7684\u5957\u63a5\u5b57\u7f13\u51b2\u533a\u5927\u5c0f\u81f3\u5c11\u9700\u8981\u662f4\u500dMSS\u7684\u5927\u5c0f\u3002\u8fd9\u91cc\u6307\u7684\u5957\u63a5\u5b57\u7f13\u51b2\uff0c\u5982\u679c\u662f\u9488\u5bf9\u5355\u5411\u7684\u4f20\u8f93\uff0c\u6bd4\u5982\u5355\u5411\u4f20\u4e00\u4e2a\u6587\u4ef6\uff0c\u6307\u7684\u662f\u53d1\u9001\u65b9\u7684\u53d1\u9001\u7f13\u51b2\u548c\u63a5\u6536\u65b9\u7684\u63a5\u6536\u7f13\u51b2\u3002\u5982\u679c\u662f\u53cc\u5411\u7684\u4f20\u8f93\uff0c\u5219\u6307\u7684\u662f\u53cc\u65b9\u7684\u63a5\u6536\u548c\u53d1\u9001\u7f13\u51b2\u3002\u4e3a\u4ec0\u4e48tcp\u5957\u63a5\u5b57\u7684\u7f13\u51b2\u533a\u9700\u8981\u81f3\u5c11&nbsp;&nbsp;&nbsp;\u662f4\u500dMSS\u7684\u5927\u5c0f\u5462\uff1f\u8fd9\u662f\u56e0\u4e3atcp\u7684\u5feb\u6062\u590d(fast&nbsp;recovery)\u7b97\u6cd5\u3002\u5feb\u6062\u590d\u7b97\u6cd5\u5b9a\u4e49\uff1a\u5982\u679c\u63a5\u6536\u7aef\u8fde\u7eed\u6536\u5230\u4e09\u4e2a\u540c\u6837\u7684ACK\uff0c\u5c31\u8ba4\u4e3a\u6709packet\u4e22\u5931\u4e86\u3002\u800c\u63a5\u6536\u7aef\u5728segment\u4e22\u5931\u540e\uff0c\u6bcf\u6536\u5230\u65b0\u7684segment\u5c31\u4e0d\u505c\u5730\u91cd\u53d1\u4e00\u4e2a\u91cd\u590d\u7684ack\u7ed9sender\u3002\u5982\u679c\u7a97\u53e3\u5927\u5c0f\u5c0f\u4e8e4\u4e2asegments,\u5c31\u4e0d\u4f1a\u6709\u4e09\u4e2a\u91cd\u590d\u7684ACK,\u6240\u4ee5\u5feb\u6062\u590d\u7b97\u6cd5\u5c31\u6ca1\u529e\u6cd5\u5de5\u4f5c\u4e86\u3002 11.&nbsp;What&nbsp;is&nbsp;bandwidth-delay&nbsp;product. A:&nbsp;The&nbsp;capacity&nbsp;of&nbsp;the&nbsp;pipe&nbsp;is&nbsp;called&nbsp;the&nbsp;bandwidth-delay&nbsp;product&nbsp;and&nbsp;we&nbsp;calculate&nbsp;this&nbsp;by&nbsp;multiplying&nbsp;the&nbsp;bandwidth(in&nbsp;bits\/sec)&nbsp;times&nbsp;the&nbsp;RTT(in&nbsp;seconds),&nbsp;converting&nbsp;the&nbsp;result&nbsp;from&nbsp;bits&nbsp;to&nbsp;bytes.&nbsp;\u5373\u7f51\u901f\u4e58\u4e0aRTT. 12.&nbsp;UDP\u6ca1\u6709send&nbsp;buffer\uff0c\u4f46\u6709\u4e00\u4e2asend&nbsp;buffer&nbsp;size.\u53ea\u8981socket\u7684buffer&nbsp;size\u5927\u4e8eLO_WATER\uff0c\u5c31\u6c38\u8fdc\u662f\u53ef\u5199\u7684\u3002 13.&nbsp;SO_REUSEADDR\u6709\u56db\u79cd\u7528\u9014\u3002\u597d\u96be\u5199\u3002\u89c1Unix&nbsp;Network&nbsp;Programming&nbsp;Section&nbsp;7.5&nbsp;\u5f71\u5370\u7248\u7b2c211\u9875\u5566\u3002 14.&nbsp;It&#39;s&nbsp;Ok&nbsp;for&nbsp;the&nbsp;MSS&nbsp;to&nbsp;be&nbsp;different&nbsp;in&nbsp;each&nbsp;direction. 15.&nbsp;Nagle\u7b97\u6cd5\u662f\u4e3a\u4e86\u51cf\u5c11small&nbsp;package\u7684\u6570\u91cf.The&nbsp;algorithm&nbsp;states&nbsp;that&nbsp;if&nbsp;a&nbsp;given&nbsp;connection&nbsp;has&nbsp;outstanding&nbsp;data,&nbsp;then&nbsp;no&nbsp;small&nbsp;packets&nbsp;will&nbsp;be&nbsp;sent&nbsp;on&nbsp;the&nbsp;connection&nbsp;in&nbsp;response&nbsp;to&nbsp;a&nbsp;user&nbsp;write&nbsp;operation&nbsp;until&nbsp;the&nbsp;existing&nbsp;data&nbsp;is&nbsp;acknowledged.&nbsp;Small&nbsp;package&nbsp;\u6307\u7684\u662f\u4efb\u4f55\u6bd4MSS\u5c0f\u7684package. 16.&nbsp;Delayed&nbsp;ACK&nbsp;algorithm:&nbsp;This&nbsp;algorithm&nbsp;causes&nbsp;TCP&nbsp;to&nbsp;not&nbsp;send&nbsp;an&nbsp;ACK&nbsp;immediately&nbsp;when&nbsp;it&nbsp;receives&nbsp;data;&nbsp;instead,&nbsp;TCP&nbsp;will&nbsp;wait&nbsp;some&nbsp;small&nbsp;amount&nbsp;of&nbsp;time&nbsp;(typically&nbsp;50-200ms)and&nbsp;only&nbsp;then&nbsp;send&nbsp;the&nbsp;ACK. 17.&nbsp;SCTP\u6709\u4e00\u4e2aSCTP_AUTOCLOSE\u5957\u63a5\u5b57\u9009\u9879\u3002This&nbsp;option&nbsp;allows&nbsp;us&nbsp;to&nbsp;fetch&nbsp;or&nbsp;set&nbsp;the&nbsp;autoclose&nbsp;time&nbsp;for&nbsp;an&nbsp;SCTP&nbsp;endpoint.&nbsp;The&nbsp;autoclose&nbsp;time&nbsp;is&nbsp;the&nbsp;number&nbsp;of&nbsp;seconds&nbsp;an&nbsp;SCTP&nbsp;association&nbsp;will&nbsp;remain&nbsp;open&nbsp;when&nbsp;idle.\u5373SCTP&nbsp;association\u80fd\u591f\u4fdd\u6301\u7a7a\u95f2\u72b6\u6001\u7684\u6700\u957f\u65f6\u95f4\u3002\u8d85\u65f6\u5c31\u4f1a\u88ab\u5173\u95ed\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,6,7],"tags":[82,116],"class_list":["post-296","post","type-post","status-publish","format-standard","hentry","category-network","category-tech_articles","category-unix_linux","tag-unix-socket","tag-116"],"_links":{"self":[{"href":"https:\/\/ykyi.net\/index.php?rest_route=\/wp\/v2\/posts\/296","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ykyi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ykyi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ykyi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ykyi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=296"}],"version-history":[{"count":0,"href":"https:\/\/ykyi.net\/index.php?rest_route=\/wp\/v2\/posts\/296\/revisions"}],"wp:attachment":[{"href":"https:\/\/ykyi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ykyi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=296"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ykyi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}