{"id":43903,"date":"2023-10-04T23:05:06","date_gmt":"2023-10-04T15:05:06","guid":{"rendered":"https:\/\/www.techphant.cn\/?p=43903"},"modified":"2023-10-08T15:29:22","modified_gmt":"2023-10-08T07:29:22","slug":"wytdqb","status":"publish","type":"post","link":"https:\/\/www.techphant.cn\/blog\/43903.html","title":{"rendered":"Websocket\u4e0eTCP\u7684\u533a\u522b"},"content":{"rendered":"
Websocket\u548cTCP\u90fd\u5c5e\u4e8e\u7f51\u7edc\u901a\u4fe1\u534f\u8bae\uff0c\u4f46\u5b83\u4eec\u4e4b\u95f4\u5b58\u5728\u4e00\u4e9b\u663e\u8457\u7684\u5dee\u5f02\uff0c\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u5b83\u4eec\u6709\u7740\u4e0d\u540c\u7684\u4f18\u52bf\u548c\u52a3\u52bf\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecdWebsocket\u548cTCP\u4e4b\u95f4\u7684\u533a\u522b\uff0c\u4ee5\u5e2e\u52a9\u8bfb\u8005\u66f4\u597d\u5730\u4e86\u89e3\u5b83\u4eec\u3002<\/p>\n
Websocket\u662f\u4e00\u79cd\u65b0\u578b\u7684\u7f51\u7edc\u534f\u8bae\uff0c\u5b83\u4f7f\u7528HTTP\u534f\u8bae\u4f5c\u4e3a\u57fa\u7840\uff0c\u4f46\u662f\u5b83\u652f\u6301\u53cc\u5411\u901a\u4fe1\uff0c\u53ef\u4ee5\u5728\u670d\u52a1\u5668\u548c\u5ba2\u6237\u7aef\u4e4b\u95f4\u8fdb\u884c\u53cc\u5411\u901a\u4fe1\u3002Websocket\u4f7f\u7528\u66f4\u5c11\u7684\u5e26\u5bbd\uff0c\u53ef\u4ee5\u63d0\u4f9b\u66f4\u5feb\u7684\u901f\u5ea6\uff0c\u5e76\u4e14\u53ef\u4ee5\u66f4\u597d\u5730\u5904\u7406\u5927\u91cf\u6570\u636e\uff0c\u56e0\u6b64\u5b83\u53ef\u4ee5\u5728\u5b9e\u65f6\u5e94\u7528\u7a0b\u5e8f\u4e2d\u53d1\u6325\u66f4\u5927\u7684\u4f5c\u7528\u3002<\/p>\n
TCP\uff08\u4f20\u8f93\u63a7\u5236\u534f\u8bae\uff09\u662f\u4e00\u79cd\u5e38\u7528\u7684\u7f51\u7edc\u534f\u8bae\uff0c\u5b83\u53ef\u4ee5\u5728\u4e24\u53f0\u8ba1\u7b97\u673a\u4e4b\u95f4\u5efa\u7acb\u53ef\u9760\u7684\u8fde\u63a5\uff0c\u4ee5\u4fbf\u8fdb\u884c\u6570\u636e\u4f20\u8f93\u3002TCP\u53ef\u4ee5\u4fdd\u8bc1\u6570\u636e\u7684\u53ef\u9760\u6027\uff0c\u53ef\u4ee5\u4fdd\u8bc1\u6570\u636e\u7684\u5b8c\u6574\u6027\u548c\u53ef\u9760\u6027\uff0c\u5e76\u4e14\u53ef\u4ee5\u4fdd\u8bc1\u6570\u636e\u7684\u6b63\u786e\u6027\u3002<\/p>\n
\u4ece\u4e0a\u9762\u7684\u4ecb\u7ecd\u53ef\u4ee5\u770b\u51fa\uff0cWebsocket\u548cTCP\u4e4b\u95f4\u5b58\u5728\u4e00\u4e9b\u663e\u8457\u7684\u5dee\u5f02\uff0c\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u5b83\u4eec\u6709\u7740\u4e0d\u540c\u7684\u4f18\u52bf\u548c\u52a3\u52bf\u3002<\/strong>Websocket\u652f\u6301\u53cc\u5411\u901a\u4fe1\uff0c\u53ef\u4ee5\u63d0\u4f9b\u66f4\u5feb\u7684\u901f\u5ea6\uff0c\u66f4\u597d\u5730\u5904\u7406\u5927\u91cf\u6570\u636e\uff0c\u5e76\u4e14\u53ef\u4ee5\u66f4\u597d\u5730\u5904\u7406\u5b9e\u65f6\u5e94\u7528\u7a0b\u5e8f\u3002TCP\u53ef\u4ee5\u4fdd\u8bc1\u6570\u636e\u4f20\u8f93\u7684\u53ef\u9760\u6027\uff0c\u53ef\u4ee5\u4fdd\u8bc1\u6570\u636e\u7684\u5b8c\u6574\u6027\u548c\u53ef\u9760\u6027\uff0c\u5e76\u4e14\u53ef\u4ee5\u4fdd\u8bc1\u6570\u636e\u7684\u6b63\u786e\u6027\u3002\u56e0\u6b64\uff0c\u5728\u9009\u62e9\u7f51\u7edc\u901a\u4fe1\u534f\u8bae\u65f6\uff0c\u5e94\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u9009\u62e9\u6700\u5408\u9002\u7684\u534f\u8bae\u3002<\/p>\n","protected":false},"excerpt":{"rendered":" Websocket\u548cTCP\u90fd\u5c5e\u4e8e\u7f51\u7edc\u901a\u4fe1\u534f\u8bae\uff0c\u4f46\u5b83\u4eec\u4e4b\u95f4\u5b58\u5728\u4e00\u4e9b\u663e\u8457\u7684\u5dee\u5f02\uff0c\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u5b83\u4eec\u6709\u7740\u4e0d\u540c\u7684\u4f18\u52bf\u548c\u52a3\u52bf\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecdWebsocket\u548cTCP\u4e4b\u95f4\u7684\u533a\u522b\uff0c\u4ee5<\/p>\n","protected":false},"author":1,"featured_media":4132,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"categories":[36],"tags":[161],"class_list":["post-43903","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-tcp"],"_links":{"self":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/43903","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/comments?post=43903"}],"version-history":[{"count":0,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/43903\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media\/4132"}],"wp:attachment":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media?parent=43903"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/categories?post=43903"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/tags?post=43903"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}