{"id":34896,"date":"2025-05-01T07:20:45","date_gmt":"2025-04-30T23:20:45","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/34896.html"},"modified":"2025-05-01T07:20:45","modified_gmt":"2025-04-30T23:20:45","slug":"tcp%e6%a6%82%e5%bf%b5%e6%a8%a1%e6%8b%9ftcp%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%8f%8a%e5%ae%a2%e6%88%b7%e7%ab%af","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/34896.html","title":{"rendered":"TCP\u6982\u5ff5+\u6a21\u62dftcp\u670d\u52a1\u5668\u53ca\u5ba2\u6237\u7aef"},"content":{"rendered":"<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"%E4%B8%80%E3%80%81TCP%E5%9F%BA%E6%9C%AC%E6%A6%82%E5%BF%B5-toc\" style=\"margin-left:0px\">\u4e00\u3001TCP\u57fa\u672c\u6982\u5ff5<\/p>\n<p id=\"%E4%BA%8C%E3%80%81ser%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%BB%A3%E7%A0%81-toc\" style=\"margin-left:0px\">\u4e8c\u3001ser\u670d\u52a1\u5668\u4ee3\u7801<\/p>\n<p id=\"%E4%B8%89%E3%80%81cil%E5%AE%A2%E6%88%B7%E7%AB%AF%E4%BB%A3%E7%A0%81%C2%A0-toc\" style=\"margin-left:0px\">\u4e09\u3001cil\u5ba2\u6237\u7aef\u4ee3\u7801\u00a0<\/p>\n<p id=\"%E5%9B%9B%E3%80%81%E9%9D%A2%E8%AF%95%E5%B8%B8%E9%97%AE%E9%97%AE%E9%A2%98-toc\" style=\"margin-left:0px\">\u56db\u3001\u9762\u8bd5\u5e38\u95ee\u95ee\u9898<\/p>\n<p id=\"4.1%C2%A0TCP%E7%9A%84%E5%8F%AF%E9%9D%A0%E6%80%A7%E6%80%8E%E4%B9%88%E4%BF%9D%E8%AF%81%E6%88%96%E6%80%8E%E4%B9%88%E5%AE%9E%E7%8E%B0%3F-toc\" style=\"margin-left:40px\">4.1\u00a0TCP\u7684\u53ef\u9760\u6027\u600e\u4e48\u4fdd\u8bc1\u6216\u600e\u4e48\u5b9e\u73b0?<\/p>\n<p id=\"4.2%20%E5%85%B7%E4%BD%93%E8%AF%B4%E4%B8%80%E4%B8%8B%E6%BB%91%E5%8A%A8%E7%AA%97%E5%8F%A3-toc\" style=\"margin-left:40px\">4.2 \u5177\u4f53\u8bf4\u4e00\u4e0b\u6ed1\u52a8\u7a97\u53e3<\/p>\n<hr id=\"hr-toc\" \/>\n<h2 id=\"%E4%B8%80%E3%80%81TCP%E5%9F%BA%E6%9C%AC%E6%A6%82%E5%BF%B5\">\u4e00\u3001TCP\u57fa\u672c\u6982\u5ff5<\/h2>\n<p>TCP&#xff08;Transmission Control Protocol&#xff0c;\u4f20\u8f93\u63a7\u5236\u534f\u8bae&#xff09;\u662f\u4e00\u79cd\u9762\u5411\u8fde\u63a5\u7684\u3001\u53ef\u9760\u7684\u3001\u57fa\u4e8e\u5b57\u8282\u6d41\u7684\u4f20\u8f93\u5c42\u534f\u8bae\u3002\u4ee5\u4e0b\u662fTCP\u7684\u4e00\u4e9b\u57fa\u672c\u6982\u5ff5&#xff1a;<\/p>\n<li>\n<p>\u9762\u5411\u8fde\u63a5&#xff1a;\u5728\u6570\u636e\u4f20\u8f93\u4e4b\u524d&#xff0c;TCP\u5728\u53d1\u9001\u65b9\u548c\u63a5\u6536\u65b9\u4e4b\u95f4\u5efa\u7acb\u4e00\u4e2a\u8fde\u63a5\u3002\u6570\u636e\u4f20\u8f93\u5b8c\u6210\u540e&#xff0c;\u8fde\u63a5\u88ab\u91ca\u653e\u3002<\/p>\n<\/li>\n<li>\n<p>\u53ef\u9760\u6027&#xff1a;TCP\u63d0\u4f9b\u53ef\u9760\u7684\u6570\u636e\u4f20\u8f93&#xff0c;\u786e\u4fdd\u6570\u636e\u6309\u7167\u6b63\u786e\u7684\u987a\u5e8f\u5230\u8fbe\u76ee\u7684\u5730&#xff0c;\u5e76\u4e14\u53ef\u4ee5\u68c0\u6d4b\u548c\u7ea0\u6b63\u4f20\u8f93\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u7684\u9519\u8bef\u3002<\/p>\n<\/li>\n<li>\n<p>\u6d41\u63a7\u5236&#xff1a;TCP\u4f7f\u7528\u6ed1\u52a8\u7a97\u53e3\u534f\u8bae\u8fdb\u884c\u6d41\u91cf\u63a7\u5236&#xff0c;\u4ee5\u786e\u4fdd\u53d1\u9001\u7aef\u548c\u63a5\u6536\u7aef\u4e4b\u95f4\u7684\u6570\u636e\u4f20\u8f93\u901f\u7387\u5408\u7406&#xff0c;\u4e0d\u4f1a\u53d1\u751f\u6570\u636e\u4e22\u5931\u6216\u8d85\u8d1f\u8377\u7684\u60c5\u51b5\u3002<\/p>\n<\/li>\n<li>\n<p>\u62e5\u585e\u63a7\u5236&#xff1a;TCP\u901a\u8fc7\u63a7\u5236\u6570\u636e\u5305\u7684\u53d1\u9001\u901f\u7387\u6765\u907f\u514d\u7f51\u7edc\u62e5\u585e&#xff0c;\u4ee5\u786e\u4fdd\u7f51\u7edc\u7684\u7a33\u5b9a\u6027\u548c\u6d41\u7545\u6027\u3002<\/p>\n<\/li>\n<li>\n<p>\u5206\u6bb5\u548c\u91cd\u7ec4&#xff1a;TCP\u5728\u4f20\u8f93\u6570\u636e\u65f6\u4f1a\u5c06\u6570\u636e\u5206\u6210\u8f83\u5c0f\u7684\u6570\u636e\u6bb5\u8fdb\u884c\u4f20\u8f93&#xff0c;\u63a5\u6536\u65b9\u6536\u5230\u6570\u636e\u540e\u4f1a\u91cd\u65b0\u7ec4\u88c5\u6210\u5b8c\u6574\u7684\u6570\u636e\u3002<\/p>\n<\/li>\n<li>\n<p>\u7aef\u5230\u7aef\u901a\u4fe1&#xff1a;TCP\u662f\u7aef\u5230\u7aef\u901a\u4fe1\u534f\u8bae&#xff0c;\u610f\u5473\u7740\u901a\u4fe1\u53cc\u65b9\u76f4\u63a5\u8fdb\u884c\u6570\u636e\u4f20\u8f93&#xff0c;\u800c\u4e0d\u9700\u8981\u7ecf\u8fc7\u4e2d\u95f4\u8bbe\u5907\u7684\u5904\u7406\u3002<\/p>\n<\/li>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"309\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250430232043-6812b04bda774.png\" width=\"477\" \/><\/p>\n<p>\u670d\u52a1\u7aef&#xff1a;<\/p>\n<p>1. socket()&#xff1a;\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5957\u63a5\u5b57\u3002 2. bind(ip&#043;port)&#xff1a;\u5c06\u5957\u63a5\u5b57\u7ed1\u5b9a\u5230\u6307\u5b9a\u7684IP\u5730\u5740\u548c\u7aef\u53e3\u53f7\u4e0a&#xff0c;\u4ee5\u4fbf\u76d1\u542c\u6765\u81ea\u8be5\u5730\u5740\u548c\u7aef\u53e3\u7684\u8fde\u63a5\u8bf7\u6c42\u3002 3. listen()&#xff1a;\u4f7f\u5957\u63a5\u5b57\u8fdb\u5165\u76d1\u542c\u72b6\u6001&#xff0c;\u7b49\u5f85\u5ba2\u6237\u7aef\u7684\u8fde\u63a5\u8bf7\u6c42\u3002 4. accept()&#xff1a;\u63a5\u53d7\u5ba2\u6237\u7aef\u7684\u8fde\u63a5\u8bf7\u6c42&#xff0c;\u5efa\u7acb\u8fde\u63a5\u3002 5. recv()&#xff1a;\u63a5\u6536\u6765\u81ea\u5ba2\u6237\u7aef\u7684\u6570\u636e\u3002 6. send()&#xff1a;\u5411\u5ba2\u6237\u7aef\u53d1\u9001\u6570\u636e\u3002 7. close()&#xff1a;\u5173\u95ed\u5957\u63a5\u5b57&#xff0c;\u7ed3\u675f\u901a\u4fe1\u3002<\/p>\n<p>\u5ba2\u6237\u7aef&#xff1a;<\/p>\n<p>1. socket()&#xff1a;\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5957\u63a5\u5b57\u3002 2. connect(ip&#043;port)&#xff1a;\u5411\u670d\u52a1\u7aef\u7684\u6307\u5b9aIP\u5730\u5740\u548c\u7aef\u53e3\u53f7\u53d1\u8d77\u8fde\u63a5\u8bf7\u6c42\u3002 3. send()&#xff1a;\u5411\u670d\u52a1\u7aef\u53d1\u9001\u6570\u636e\u3002 4. recv()&#xff1a;\u63a5\u6536\u6765\u81ea\u670d\u52a1\u7aef\u7684\u6570\u636e\u3002 5. close()&#xff1a;\u5173\u95ed\u5957\u63a5\u5b57&#xff0c;\u7ed3\u675f\u901a\u4fe1\u3002<\/p>\n<p>TCP\u7f16\u7a0b\u6d41\u7a0b&#xff1a;<\/p>\n<p>1.TCP\u670d\u52a1\u5668\u7aef\u7f16\u7a0b\u6d41\u7a0b&#xff1a;socket\u521b\u5efa\u5957\u63a5\u5b57-&gt;bind\u7ed1\u5b9aIP\u548c\u7aef\u53e3-&gt;listen\u521b\u5efa\u76d1\u542c\u961f\u5217-&gt;accept\u63a5\u53d7\u8fde\u63a5-&gt;receive\u63a5\u6536\u6570\u636e-&gt;send\u53d1\u9001\u6570\u636e-&gt;close\u5173\u95ed\u8fde\u63a5\u3002<\/p>\n<p>2.TCP\u5ba2\u6237\u7aef\u7f16\u7a0b\u6d41\u7a0b&#xff1a;socket\u521b\u5efa\u5957\u63a5\u5b57-&gt;connect\u53d1\u8d77\u8fde\u63a5-&gt;send\u53d1\u9001\u6570\u636e-&gt;receive\u63a5\u6536\u6570\u636e-&gt;close\u5173\u95ed\u8fde\u63a5\u3002<\/p>\n<h2 id=\"%E4%BA%8C%E3%80%81ser%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%BB%A3%E7%A0%81\">\u4e8c\u3001ser\u670d\u52a1\u5668\u4ee3\u7801<\/h2>\n<p>TCP\u670d\u52a1\u5668\u7a0b\u5e8f&#xff0c;\u7528\u4e8e\u63a5\u53d7\u5ba2\u6237\u7aef\u7684\u8fde\u63a5\u8bf7\u6c42&#xff0c;\u5e76\u4e0e\u5ba2\u6237\u7aef\u8fdb\u884c\u6570\u636e\u4ea4\u6362 \u3002<\/p>\n<p>#include&lt;stdio.h&gt;<br \/>\n#include&lt;stdlib.h&gt;<br \/>\n#include&lt;unistd.h&gt;<br \/>\n#include&lt;string.h&gt;<br \/>\n#include&lt;sys\/socket.h&gt;<br \/>\n#include&lt;netinet\/in.h&gt;<br \/>\n#include&lt;arpa\/inet.h&gt;<\/p>\n<p>int main()<br \/>\n{<br \/>\n    \/\/\u521b\u5efa\u5957\u63a5\u5b57&#xff08;\u6253\u5f00\u6587\u4ef6&#xff0c;\u6587\u4ef6\u63cf\u8ff0\u7b26&#xff09; \u5957\u63a5\u5b57\u53ef\u4ee5\u901a\u8fc7\u7f51\u7edc\u6536\u53d1\u6570\u636e<br \/>\n    int sockfd&#061;socket(AF_INET,SOCK_STREAM,0);<br \/>\n    if(sockfd&#061;&#061;-1)<br \/>\n    {<br \/>\n        exit(1);<br \/>\n    }<\/p>\n<p>    struct sockaddr_in saddr,caddr;\/\/\u670d\u52a1\u5668\u7684ip\u7aef\u53e3<br \/>\n    memset(&amp;saddr,0,sizeof(saddr));\/\/\u6e05\u7a7a<br \/>\n    saddr.sin_family&#061;AF_INET;\/\/\u586b\u5145<br \/>\n    saddr.sin_port&#061;htons(6000);\/\/\u5236\u5b9a\u7aef\u53e3\u53f7\u4e3a6000    \u5c0f\u4e8e1024\u662f\u77e5\u540d\u7aef\u53e3&#xff0c;1024&#xff5e;4096\u662f\u4fdd\u7559\u7684\u7aef\u53e3&#xff0c;4096\u4ee5\u4e0a\u662f\u4e34\u65f6\u7aef\u53e3<br \/>\n    saddr.sin_addr.s_addr&#061;inet_addr(&#034;127.0.0.1&#034;);<br \/>\n    \/\/\u6307\u5b9aip&#043;\u7aef\u53e3<br \/>\n    int res&#061;bind(sockfd,(struct sockaddr*)&amp;saddr,sizeof(saddr));\/\/\u7ed1\u5b9a&#xff0c;\u6307\u5b9a\u5e94\u7528\u7a0b\u5e8f\u4f7f\u7528\u7684ip\u53ca\u7aef\u53e3<\/p>\n<p>    if(res&#061;&#061;-1)<br \/>\n    {<br \/>\n        printf(&#034;bind err\\\\n&#034;);<br \/>\n        exit(1);<br \/>\n    }<\/p>\n<p>    res&#061;listen(sockfd,5);<br \/>\n    if(res&#061;&#061;-1)<br \/>\n    {<br \/>\n        exit(1);<br \/>\n    }<br \/>\n    while(1)<br \/>\n    {<br \/>\n        int len&#061;sizeof(caddr);\/\/accept\u63a5\u53d7\u8fde\u63a5&#xff0c;\u5982\u679c\u6ca1\u4eba\u8fde\u63a5&#xff0c;\u5219\u963b\u585e<br \/>\n        int c&#061;accept(sockfd,(struct sockaddr*)&amp;caddr,&amp;len);<br \/>\n        if(c&lt;0)<br \/>\n        {<br \/>\n            break;<br \/>\n        }<\/p>\n<p>        printf(&#034;accept c&#061;%d\\\\n&#034;,c);<br \/>\n        pid_t pid&#061;fork();<br \/>\n        if(pid&#061;&#061;0)<br \/>\n        {<br \/>\n            while(1)<br \/>\n            {<br \/>\n                char buff[128]&#061;{0};<br \/>\n                int n&#061;recv(c,buff,127,0);\/\/\u63a5\u53d7\u8fde\u63a5&#xff0c;\u63a5\u6536\u6570\u636e&#xff0c;\u4f1a\u963b\u585e,\u4e5f\u53ef\u4ee5\u6362\u6210read()<br \/>\n                if(n&lt;&#061;0)<br \/>\n                {<br \/>\n                    break;<br \/>\n                }<br \/>\n                printf(&#034;recv:%s\\\\n&#034;,buff);<br \/>\n                send(c,&#034;ok&#034;,2,0);\/\/\u53d1\u9001\u6570\u636e&#xff0c;\u4e5f\u53ef\u4ee5\u6362\u6210write()<br \/>\n            }<br \/>\n            printf(&#034;client close\\\\n&#034;);<br \/>\n            close(c);<\/p>\n<p>            exit(0);<br \/>\n        }<\/p>\n<p>        close(c);<br \/>\n    }<br \/>\n}<\/p>\n<li>\n<p>\u5bfc\u5165\u5934\u6587\u4ef6&#xff1a;\u7a0b\u5e8f\u4e2d\u5bfc\u5165\u4e86\u4e00\u4e9b\u6807\u51c6\u7684\u5934\u6587\u4ef6&#xff0c;\u5305\u62ecstdio.h\u3001stdlib.h\u3001unistd.h\u3001string.h\u3001sys\/socket.h\u3001netinet\/in.h\u3001arpa\/inet.h\u3002<\/p>\n<\/li>\n<li>\n<p>\u521b\u5efa\u5957\u63a5\u5b57&#xff1a;\u4f7f\u7528socket\u51fd\u6570\u521b\u5efa\u4e00\u4e2a\u5957\u63a5\u5b57&#xff0c;\u540c\u6837\u6307\u5b9a\u534f\u8bae\u65cf(AF_INET&#xff0c;\u8868\u793aIPv4)\u3001\u5957\u63a5\u5b57\u7c7b\u578b(SOCK_STREAM&#xff0c;\u8868\u793aTCP\u6d41\u5957\u63a5\u5b57)\u548c\u534f\u8bae\u53c2\u6570(0)\u3002<\/p>\n<\/li>\n<li>\n<p>\u8bbe\u7f6e\u670d\u52a1\u5668\u5730\u5740&#xff1a;\u5b9a\u4e49\u4e86\u4e24\u4e2a\u7ed3\u6784\u4f53\u53d8\u91cfsaddr\u548ccaddr&#xff0c;\u5206\u522b\u8868\u793a\u670d\u52a1\u5668\u548c\u5ba2\u6237\u7aef\u5730\u5740\u3002\u521d\u59cb\u5316saddr&#xff0c;\u5e76\u6307\u5b9a\u670d\u52a1\u5668\u7684IP\u5730\u5740\u4e3a&#034;127.0.0.1&#034;&#xff0c;\u7aef\u53e3\u53f7\u4e3a6000\u3002<\/p>\n<\/li>\n<li>\n<p>\u7ed1\u5b9a\u5730\u5740&#xff1a;\u4f7f\u7528bind\u51fd\u6570\u5c06\u5957\u63a5\u5b57\u548c\u670d\u52a1\u5668\u5730\u5740\u7ed1\u5b9a\u5728\u4e00\u8d77&#xff0c;\u6307\u5b9a\u670d\u52a1\u5668\u5e94\u7528\u7a0b\u5e8f\u4f7f\u7528\u7684IP\u5730\u5740\u548c\u7aef\u53e3\u53f7\u3002<\/p>\n<\/li>\n<li>\n<p>\u76d1\u542c\u8fde\u63a5&#xff1a;\u4f7f\u7528listen\u51fd\u6570\u76d1\u542c\u8fde\u63a5\u8bf7\u6c42&#xff0c;\u6307\u5b9a\u6700\u5927\u8fde\u63a5\u6570\u4e3a5\u3002<\/p>\n<\/li>\n<li>\n<p>\u63a5\u53d7\u8fde\u63a5&#xff1a;\u901a\u8fc7accept\u51fd\u6570\u63a5\u53d7\u5ba2\u6237\u7aef\u7684\u8fde\u63a5\u8bf7\u6c42\u3002\u5982\u679c\u6709\u5ba2\u6237\u7aef\u8fde\u63a5&#xff0c;\u5219\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5957\u63a5\u5b57\u63cf\u8ff0\u7b26c&#xff0c;\u5e76\u63a5\u53d7\u8fde\u63a5\u3002<\/p>\n<\/li>\n<li>\n<p>\u591a\u8fdb\u7a0b\u5904\u7406&#xff1a;\u5728\u5b50\u8fdb\u7a0b\u4e2d\u5904\u7406\u5ba2\u6237\u7aef\u7684\u6570\u636e\u901a\u4fe1\u3002\u5728\u5904\u7406\u6570\u636e\u7684\u5faa\u73af\u4e2d&#xff0c;\u63a5\u6536\u5ba2\u6237\u7aef\u53d1\u9001\u7684\u6570\u636e&#xff0c;\u5982\u679c\u63a5\u6536\u5230\u6570\u636e\u5219\u6253\u5370\u5e76\u53d1\u9001&#034;ok&#034;\u56de\u590d\u5ba2\u6237\u7aef\u3002\u5982\u679c\u63a5\u6536\u5230\u7684\u6570\u636e\u957f\u5ea6\u5c0f\u4e8e\u7b49\u4e8e0&#xff0c;\u8868\u793a\u5ba2\u6237\u7aef\u5173\u95ed\u8fde\u63a5&#xff0c;\u5219\u8df3\u51fa\u5904\u7406\u6570\u636e\u7684\u5faa\u73af&#xff0c;\u5173\u95ed\u5ba2\u6237\u7aef\u7684\u5957\u63a5\u5b57\u63cf\u8ff0\u7b26c\u3002<\/p>\n<\/li>\n<li>\n<p>\u591a\u8fdb\u7a0b\u5904\u7406&#xff1a;\u5728\u7236\u8fdb\u7a0b\u4e2d\u5173\u95ed\u5df2\u63a5\u53d7\u7684\u5ba2\u6237\u7aef\u8fde\u63a5\u3002<\/p>\n<\/li>\n<h2 id=\"%E4%B8%89%E3%80%81cil%E5%AE%A2%E6%88%B7%E7%AB%AF%E4%BB%A3%E7%A0%81%C2%A0\">\u4e09\u3001cil\u5ba2\u6237\u7aef\u4ee3\u7801\u00a0<\/h2>\n<p>\u5ba2\u6237\u7aef\u7a0b\u5e8f&#xff0c;\u7528\u4e8e\u8fde\u63a5\u5230\u670d\u52a1\u5668\u5e76\u8fdb\u884c\u6570\u636e\u4ea4\u6362\u3002<\/p>\n<p>#include&lt;stdio.h&gt;<br \/>\n#include&lt;stdlib.h&gt;<br \/>\n#include&lt;unistd.h&gt;<br \/>\n#include&lt;string.h&gt;<br \/>\n#include&lt;sys\/socket.h&gt;<br \/>\n#include&lt;netinet\/in.h&gt;<br \/>\n#include&lt;arpa\/inet.h&gt;<\/p>\n<p>int main()<br \/>\n{<br \/>\n    \/\/\u521b\u5efa\u5957\u63a5\u5b57<br \/>\n    int sockfd&#061;socket(AF_INET,SOCK_STREAM,0);<br \/>\n    if(sockfd&#061;&#061;-1)<br \/>\n    {<br \/>\n        exit(1);<br \/>\n    }<\/p>\n<p>    struct  sockaddr_in saddr;\/\/\u6307\u5b9a\u670d\u52a1\u5668\u7684ip\u548c\u7aef\u53e3port<br \/>\n    memset(&amp;saddr,0,sizeof(saddr));<br \/>\n    saddr.sin_family&#061;AF_INET;<br \/>\n    saddr.sin_port&#061;htons(6000);\/\/htons \u8f6c\u4e3a\u7f51\u7edc\u5b57\u8282\u5e8f\u5217  \u5927\u7aef<br \/>\n    saddr.sin_addr.s_addr&#061;inet_addr(&#034;127.0.0.1&#034;);<br \/>\n    int res&#061;connect(sockfd,(struct sockaddr*)&amp;saddr,sizeof(saddr));<br \/>\n    if(res&#061;&#061;-1)<br \/>\n    {<br \/>\n        printf(&#034;connect err\\\\n&#034;);<br \/>\n        exit(1);<br \/>\n    }<\/p>\n<p>    char buff[128]&#061;{0};<br \/>\n    printf(&#034;input:\\\\n&#034;);<br \/>\n    fgets(buff,128,stdin);<\/p>\n<p>    send(sockfd,buff,strlen(buff)-1,0);\/\/\u53ef\u4ee5\u7528write<\/p>\n<p>    memset(buff,0,sizeof(buff));<br \/>\n    recv(sockfd,buff,127,0);<br \/>\n    printf(&#034;buff&#061;%s\\\\n&#034;,buff);<br \/>\n    close(sockfd);<br \/>\n    exit(0);<br \/>\n}<\/p>\n<li>\n<p>\u5bfc\u5165\u5934\u6587\u4ef6&#xff1a;\u7a0b\u5e8f\u4e2d\u5bfc\u5165\u4e86\u4e00\u4e9b\u6807\u51c6\u7684\u5934\u6587\u4ef6&#xff0c;\u5305\u62ecstdio.h\u3001stdlib.h\u3001unistd.h\u3001string.h\u3001sys\/socket.h\u3001netinet\/in.h\u3001arpa\/inet.h\u3002<\/p>\n<\/li>\n<li>\n<p>\u521b\u5efa\u5957\u63a5\u5b57&#xff1a;\u4f7f\u7528socket\u51fd\u6570\u521b\u5efa\u4e00\u4e2a\u5957\u63a5\u5b57&#xff0c;\u540c\u6837\u6307\u5b9a\u534f\u8bae\u65cf(AF_INET&#xff0c;\u8868\u793aIPv4)\u3001\u5957\u63a5\u5b57\u7c7b\u578b(SOCK_STREAM&#xff0c;\u8868\u793aTCP\u6d41\u5957\u63a5\u5b57)\u548c\u534f\u8bae\u53c2\u6570(0)\u3002<\/p>\n<\/li>\n<li>\n<p>\u8bbe\u7f6e\u670d\u52a1\u5668\u5730\u5740&#xff1a;\u5b9a\u4e49\u4e86\u4e00\u4e2a\u7ed3\u6784\u4f53\u53d8\u91cfsaddr&#xff0c;\u8868\u793a\u670d\u52a1\u5668\u5730\u5740\u3002\u521d\u59cb\u5316saddr&#xff0c;\u5e76\u6307\u5b9a\u670d\u52a1\u5668\u7684IP\u5730\u5740\u4e3a&#034;127.0.0.1&#034;&#xff0c;\u7aef\u53e3\u53f7\u4e3a6000\u3002<\/p>\n<\/li>\n<li>\n<p>\u8fde\u63a5\u670d\u52a1\u5668&#xff1a;\u4f7f\u7528connect\u51fd\u6570\u8fde\u63a5\u670d\u52a1\u5668&#xff0c;\u5c06\u5957\u63a5\u5b57\u548c\u670d\u52a1\u5668\u5730\u5740\u7ed1\u5b9a\u5728\u4e00\u8d77&#xff0c;\u8fde\u63a5\u5230\u6307\u5b9a\u7684\u670d\u52a1\u5668IP\u548c\u7aef\u53e3\u3002<\/p>\n<\/li>\n<li>\n<p>\u53d1\u9001\u548c\u63a5\u6536\u6570\u636e&#xff1a;\u63d0\u793a\u7528\u6237\u8f93\u5165\u6570\u636e&#xff0c;\u901a\u8fc7fgets\u51fd\u6570\u8bfb\u53d6\u7528\u6237\u8f93\u5165\u7684\u6570\u636e\u5230\u7f13\u51b2\u533abuff\u4e2d\u3002\u7136\u540e\u4f7f\u7528send\u51fd\u6570\u5c06\u6570\u636e\u53d1\u9001\u7ed9\u670d\u52a1\u5668&#xff0c;\u53d1\u9001\u7684\u6570\u636e\u957f\u5ea6\u4e3a\u8f93\u5165\u957f\u5ea6\u51cf\u53bb\u6362\u884c\u7b26\u3002\u63a5\u6536\u670d\u52a1\u5668\u8fd4\u56de\u7684\u6570\u636e&#xff0c;\u4f7f\u7528recv\u51fd\u6570\u5c06\u6570\u636e\u8bfb\u53d6\u5230buff\u4e2d\u3002<\/p>\n<\/li>\n<li>\n<p>\u6253\u5370\u6570\u636e&#xff1a;\u5c06\u63a5\u6536\u5230\u7684\u6570\u636e\u6253\u5370\u8f93\u51fa\u3002<\/p>\n<\/li>\n<li>\n<p>\u5173\u95ed\u8fde\u63a5&#xff1a;\u4f7f\u7528close\u51fd\u6570\u5173\u95ed\u5957\u63a5\u5b57&#xff0c;\u7ed3\u675f\u5ba2\u6237\u7aef\u7a0b\u5e8f\u3002<\/p>\n<\/li>\n<p>\u8fd0\u884c\u7ed3\u679c&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"140\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250430232043-6812b04beccd4.png\" width=\"697\" \/><\/p>\n<h2 id=\"%E5%9B%9B%E3%80%81%E9%9D%A2%E8%AF%95%E5%B8%B8%E9%97%AE%E9%97%AE%E9%A2%98\">\u56db\u3001\u9762\u8bd5\u5e38\u95ee\u95ee\u9898<\/h2>\n<h3 id=\"4.1%C2%A0TCP%E7%9A%84%E5%8F%AF%E9%9D%A0%E6%80%A7%E6%80%8E%E4%B9%88%E4%BF%9D%E8%AF%81%E6%88%96%E6%80%8E%E4%B9%88%E5%AE%9E%E7%8E%B0%3F\">4.1\u00a0TCP\u7684\u53ef\u9760\u6027\u600e\u4e48\u4fdd\u8bc1\u6216\u600e\u4e48\u5b9e\u73b0?<\/h3>\n<p>\u7b54&#xff1a;1.\u5e94\u7b54\u786e\u8ba4&#xff0c;\u8d85\u65f6\u91cd\u4f20\u3002<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 2.\u4e71\u5e8f\u91cd\u62cd&#xff0c;\u53bb\u91cd\u3002<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 3.\u6ed1\u52a8\u7a97\u53e3&#xff0c;\u6d41\u91cf\u63a7\u5236\u3002<\/p>\n<h3 id=\"4.2%20%E5%85%B7%E4%BD%93%E8%AF%B4%E4%B8%80%E4%B8%8B%E6%BB%91%E5%8A%A8%E7%AA%97%E5%8F%A3\">4.2 \u5177\u4f53\u8bf4\u4e00\u4e0b\u6ed1\u52a8\u7a97\u53e3<\/h3>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0TCP (Transmission Control Protocol) \u4e2d\u7684\u6ed1\u52a8\u7a97\u53e3\u662f\u4e00\u79cd\u6d41\u91cf\u63a7\u5236\u548c\u53ef\u9760\u4f20\u8f93\u7684\u673a\u5236\u3002\u5b83\u5141\u8bb8\u53d1\u9001\u65b9\u5728\u53d1\u9001\u6570\u636e\u65f6\u4e00\u6b21\u4f20\u8f93\u591a\u4e2a\u6570\u636e\u5305\u800c\u4e0d\u9700\u8981\u7b49\u5f85\u786e\u8ba4&#xff0c;\u4ece\u800c\u63d0\u9ad8\u4e86\u7f51\u7edc\u7684\u6548\u7387\u3002\u6ed1\u52a8\u7a97\u53e3\u7684\u5927\u5c0f\u53d6\u51b3\u4e8e\u63a5\u6536\u65b9\u548c\u53d1\u9001\u65b9\u4e4b\u95f4\u7684\u534f\u5546&#xff0c;\u53d7\u9650\u4e8e\u7f51\u7edc\u5e26\u5bbd\u3001\u5ef6\u8fdf\u7b49\u56e0\u7d20\u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5728 TCP \u7684\u6ed1\u52a8\u7a97\u53e3\u4e2d&#xff0c;\u63a5\u6536\u65b9\u4f1a\u53d1\u9001\u4e00\u4e2a\u7a97\u53e3\u5927\u5c0f\u7684\u503c\u7ed9\u53d1\u9001\u65b9&#xff0c;\u8868\u793a\u80fd\u591f\u63a5\u6536\u7684\u6570\u636e\u91cf\u3002\u53d1\u9001\u65b9\u6839\u636e\u8fd9\u4e2a\u7a97\u53e3\u5927\u5c0f\u6765\u63a7\u5236\u53d1\u9001\u7684\u6570\u636e\u91cf&#xff0c;\u786e\u4fdd\u4e0d\u4f1a\u8d85\u51fa\u63a5\u6536\u65b9\u7684\u5904\u7406\u80fd\u529b\u3002\u4e00\u65e6\u53d1\u9001\u65b9\u53d1\u9001\u4e86\u7a97\u53e3\u5927\u5c0f\u7684\u6570\u636e\u4e4b\u540e&#xff0c;\u5c31\u9700\u8981\u7b49\u5f85\u63a5\u6536\u65b9\u53d1\u9001\u786e\u8ba4\u4fe1\u606f&#xff08;ACK&#xff09;\u624d\u80fd\u53d1\u9001\u4e0b\u4e00\u6279\u6570\u636e\u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u901a\u8fc7\u6ed1\u52a8\u7a97\u53e3\u673a\u5236&#xff0c;TCP \u5b9e\u73b0\u4e86\u53ef\u9760\u7684\u6570\u636e\u4f20\u8f93\u3002\u5982\u679c\u53d1\u9001\u65b9\u672a\u6536\u5230\u63a5\u6536\u65b9\u7684\u786e\u8ba4\u4fe1\u606f&#xff0c;\u53d1\u9001\u65b9\u4f1a\u91cd\u65b0\u53d1\u9001\u76f8\u5e94\u7684\u6570\u636e&#xff0c;\u76f4\u5230\u63a5\u6536\u65b9\u6b63\u786e\u63a5\u6536\u3002\u8fd9\u6837\u53ef\u4ee5\u4fdd\u8bc1\u6570\u636e\u4f20\u8f93\u7684\u6b63\u786e\u6027\u548c\u5b8c\u6574\u6027\u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u603b\u7684\u6765\u8bf4&#xff0c;TCP \u4e2d\u7684\u6ed1\u52a8\u7a97\u53e3\u5bf9\u4e8e\u4fdd\u8bc1\u6570\u636e\u7684\u53ef\u9760\u4f20\u8f93\u8d77\u7740\u81f3\u5173\u91cd\u8981\u7684\u4f5c\u7528&#xff0c;\u901a\u8fc7\u6709\u6548\u5730\u63a7\u5236\u6570\u636e\u6d41\u91cf\u548c\u534f\u5546\u7a97\u53e3\u5927\u5c0f&#xff0c;\u53ef\u4ee5\u63d0\u9ad8\u7f51\u7edc\u7684\u541e\u5410\u91cf\u548c\u4f20\u8f93\u6548\u7387\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb938\u6b21\uff0c\u70b9\u8d5e12\u6b21\uff0c\u6536\u85cf15\u6b21\u3002\u5982\u679c\u63a5\u6536\u5230\u7684\u6570\u636e\u957f\u5ea6\u5c0f\u4e8e\u7b49\u4e8e0\uff0c\u8868\u793a\u5ba2\u6237\u7aef\u5173\u95ed\u8fde\u63a5\uff0c\u5219\u8df3\u51fa\u5904\u7406\u6570\u636e\u7684\u5faa\u73af\uff0c\u5173\u95ed\u5ba2\u6237\u7aef\u7684\u5957\u63a5\u5b57\u63cf\u8ff0\u7b26c\u3002\u5bfc\u5165\u5934\u6587\u4ef6\uff1a\u7a0b\u5e8f\u4e2d\u5bfc\u5165\u4e86\u4e00\u4e9b\u6807\u51c6\u7684\u5934\u6587\u4ef6\uff0c\u5305\u62ecstdio.h\u3001stdlib.h\u3001unistd.h\u3001string.h\u3001sys\/socket.h\u3001netinet\/in.h\u3001arpa\/inet.h\u3002\u5bfc\u5165\u5934\u6587\u4ef6\uff1a\u7a0b\u5e8f\u4e2d\u5bfc\u5165\u4e86\u4e00\u4e9b\u6807\u51c6\u7684\u5934\u6587\u4ef6\uff0c\u5305\u62ecstdio.h\u3001stdlib.h\u3001unistd.h\u3001string.h\u3001sys\/socket.h\u3001netinet\/in.h\u3001arpa\/inet.h\u3002<\/p>\n","protected":false},"author":2,"featured_media":34894,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,205,43,78],"topic":[],"class_list":["post-34896","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-linux","tag-tcp-ip","tag-43","tag-78"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>TCP\u6982\u5ff5+\u6a21\u62dftcp\u670d\u52a1\u5668\u53ca\u5ba2\u6237\u7aef - \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\/34896.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"TCP\u6982\u5ff5+\u6a21\u62dftcp\u670d\u52a1\u5668\u53ca\u5ba2\u6237\u7aef - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb938\u6b21\uff0c\u70b9\u8d5e12\u6b21\uff0c\u6536\u85cf15\u6b21\u3002\u5982\u679c\u63a5\u6536\u5230\u7684\u6570\u636e\u957f\u5ea6\u5c0f\u4e8e\u7b49\u4e8e0\uff0c\u8868\u793a\u5ba2\u6237\u7aef\u5173\u95ed\u8fde\u63a5\uff0c\u5219\u8df3\u51fa\u5904\u7406\u6570\u636e\u7684\u5faa\u73af\uff0c\u5173\u95ed\u5ba2\u6237\u7aef\u7684\u5957\u63a5\u5b57\u63cf\u8ff0\u7b26c\u3002\u5bfc\u5165\u5934\u6587\u4ef6\uff1a\u7a0b\u5e8f\u4e2d\u5bfc\u5165\u4e86\u4e00\u4e9b\u6807\u51c6\u7684\u5934\u6587\u4ef6\uff0c\u5305\u62ecstdio.h\u3001stdlib.h\u3001unistd.h\u3001string.h\u3001sys\/socket.h\u3001netinet\/in.h\u3001arpa\/inet.h\u3002\u5bfc\u5165\u5934\u6587\u4ef6\uff1a\u7a0b\u5e8f\u4e2d\u5bfc\u5165\u4e86\u4e00\u4e9b\u6807\u51c6\u7684\u5934\u6587\u4ef6\uff0c\u5305\u62ecstdio.h\u3001stdlib.h\u3001unistd.h\u3001string.h\u3001sys\/socket.h\u3001netinet\/in.h\u3001arpa\/inet.h\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/34896.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-30T23:20:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250430232043-6812b04bda774.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\/34896.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/34896.html\",\"name\":\"TCP\u6982\u5ff5+\u6a21\u62dftcp\u670d\u52a1\u5668\u53ca\u5ba2\u6237\u7aef - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-30T23:20:45+00:00\",\"dateModified\":\"2025-04-30T23:20:45+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/34896.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/34896.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/34896.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"TCP\u6982\u5ff5+\u6a21\u62dftcp\u670d\u52a1\u5668\u53ca\u5ba2\u6237\u7aef\"}]},{\"@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":"TCP\u6982\u5ff5+\u6a21\u62dftcp\u670d\u52a1\u5668\u53ca\u5ba2\u6237\u7aef - \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\/34896.html","og_locale":"zh_CN","og_type":"article","og_title":"TCP\u6982\u5ff5+\u6a21\u62dftcp\u670d\u52a1\u5668\u53ca\u5ba2\u6237\u7aef - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb938\u6b21\uff0c\u70b9\u8d5e12\u6b21\uff0c\u6536\u85cf15\u6b21\u3002\u5982\u679c\u63a5\u6536\u5230\u7684\u6570\u636e\u957f\u5ea6\u5c0f\u4e8e\u7b49\u4e8e0\uff0c\u8868\u793a\u5ba2\u6237\u7aef\u5173\u95ed\u8fde\u63a5\uff0c\u5219\u8df3\u51fa\u5904\u7406\u6570\u636e\u7684\u5faa\u73af\uff0c\u5173\u95ed\u5ba2\u6237\u7aef\u7684\u5957\u63a5\u5b57\u63cf\u8ff0\u7b26c\u3002\u5bfc\u5165\u5934\u6587\u4ef6\uff1a\u7a0b\u5e8f\u4e2d\u5bfc\u5165\u4e86\u4e00\u4e9b\u6807\u51c6\u7684\u5934\u6587\u4ef6\uff0c\u5305\u62ecstdio.h\u3001stdlib.h\u3001unistd.h\u3001string.h\u3001sys\/socket.h\u3001netinet\/in.h\u3001arpa\/inet.h\u3002\u5bfc\u5165\u5934\u6587\u4ef6\uff1a\u7a0b\u5e8f\u4e2d\u5bfc\u5165\u4e86\u4e00\u4e9b\u6807\u51c6\u7684\u5934\u6587\u4ef6\uff0c\u5305\u62ecstdio.h\u3001stdlib.h\u3001unistd.h\u3001string.h\u3001sys\/socket.h\u3001netinet\/in.h\u3001arpa\/inet.h\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/34896.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-30T23:20:45+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250430232043-6812b04bda774.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\/34896.html","url":"https:\/\/www.wsisp.com\/helps\/34896.html","name":"TCP\u6982\u5ff5+\u6a21\u62dftcp\u670d\u52a1\u5668\u53ca\u5ba2\u6237\u7aef - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-30T23:20:45+00:00","dateModified":"2025-04-30T23:20:45+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/34896.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/34896.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/34896.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"TCP\u6982\u5ff5+\u6a21\u62dftcp\u670d\u52a1\u5668\u53ca\u5ba2\u6237\u7aef"}]},{"@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\/34896","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=34896"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/34896\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/34894"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=34896"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=34896"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=34896"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=34896"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}