{"id":241917,"date":"2022-05-12T09:11:51","date_gmt":"2022-05-12T01:11:51","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=241917"},"modified":"2022-05-04T19:13:32","modified_gmt":"2022-05-04T11:13:32","slug":"tcp-sticky-unpacking","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/tcp-sticky-unpacking.html","title":{"rendered":"TCP\u7684\u7c98\u5305\u62c6\u5305\u6280\u672f"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | TCP \u662f\u4e00\u4e2a\u9762\u5411\u300c\u6d41\u300d\u7684\u534f\u8bae\uff0c\u6240\u8c13\u6d41\u5c31\u662f\u6ca1\u6709\u754c\u9650\u7684\u4e00\u957f\u4e32\u4e8c\u8fdb\u5236\u6570\u636e\u3002\u5728\u5b9e\u9645\u7684\u4f20\u8f93\u8fc7\u7a0b\u4e2d\uff0cTCP \u4f1a\u6839\u636e\u7f51\u7edc\u60c5\u51b5\u5c06\u6570\u636e\u5305\u8fdb\u884c\u62c6\u5206\u6216\u8005\u62fc\u88c5\uff0c\u5982\u679c\u4e1a\u52a1\u6ca1\u6709\u5b9a\u4e49\u4e00\u4e2a\u660e\u786e\u7684\u754c\u9650\u89c4\u5219\uff0c\u5728\u5e94\u7528\u5c42\u7684\u4e1a\u52a1\u4e0a\u5c31\u4f1a\u51fa\u73b0\u7c98\u5305\u62c6\u5305\u7684\u73b0\u8c61\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n \u5e73\u65f6\u5927\u5bb6\u5728\u7f51\u7edc\u7f16\u7a0b\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u4f1a\u9047\u5230\u8fd9\u6837\u4e00\u79cd\u73b0\u8c61\uff1a\u5ba2\u6237\u7aef\u53d1\u9001\u4e86\u4e00\u957f\u4e32\u6d88\u606f\uff0c\u670d\u52a1\u7aef\u63a5\u53d7\u7684\u6d88\u606f\u63c9\u5728\u4e00\u8d77\u6216\u8005\u88ab\u62c6\u5206\u4e86\uff0c\u8fd9\u6837\u5c31\u4f1a\u9020\u6210\u6d88\u606f\u96be\u4ee5\u88ab\u6b63\u786e\u7406\u89e3\u3002\u6bd4\u5982\u8bf4\u6709\u4e00\u5929\u4f60\u7279\u522b\u60f3\u559d\u5976\u8336\uff0c\u770b\u4e86\u4e00\u4e0b\u5916\u5356\uff0c\u300c\u4e00\u70b9\u70b9\u300d\u7684\u5976\u8336\u770b\u7740\u4e0d\u9519\uff0c(\u4e00\u70b9\u70b9\u8d76\u7d27\u7ed9\u6211\u6253\u94b1 doge)\uff0c\u4e8e\u662f\u4f60\u5728\u7fa4\u91cc\u53d1\u4e86\u4e00\u6761\u6d88\u606f\uff0c\u60f3\u627e\u51e0\u4e2a\u4eba\u62fc\u5976\u8336\uff1a \u54c8\u54c8\uff0c\u8bb2\u4e86\u4e00\u4e2a\u51b7\u7b11\u8bdd\u3002\u7528\u4e13\u4e1a\u7684\u672f\u8bed\u6765\u8bf4\u8fd9\u79cd\u73b0\u8c61\u5c31\u662f\u300c\u62c6\u5305\u300d\u4e86\uff0c\u6211\u4eec\u63a5\u7740\u5f80\u4e0b\u8bb2\u3002<\/p>\n TCP \u7c98\u5305\u62c6\u5305\u7684\u73b0\u8c61<\/strong><\/div>\n \u7c98\u5305\u62c6\u5305\u95ee\u9898\u4e00\u822c\u662f\u5904\u4e8e\u5e94\u7528\u5c42\u4e0b\u7684\u95ee\u9898\uff0c\u5728\u6570\u636e\u94fe\u8def\u5c42\u3001\u7f51\u7edc\u5c42\u4ee5\u53ca\u4f20\u8f93\u5c42\u90fd\u6709\u53ef\u80fd\u53d1\u751f\u3002\u6211\u4eec\u65e5\u5e38\u7684\u7f51\u7edc\u5e94\u7528\u5f00\u53d1\u5927\u591a\u90fd\u5728\u4f20\u8f93\u5c42\u8fdb\u884c\uff0c\u56e0\u6b64\u672c\u6587\u7740\u91cd\u8bb2\u89e3\u4f20\u8f93\u5c42\u7c98\u5305\u62c6\u5305\u95ee\u9898\u3002<\/p>\n \u4f20\u8f93\u5c42\u6709\u4e24\u4e2a\u534f\u8bae\u6211\u4eec\u90fd\u5f88\u719f\u6089\uff1aUDP \u548c TCP\uff0cUDP\u6709\u6d88\u606f\u4fdd\u62a4\u8fb9\u754c\uff0c\u4e0d\u4f1a\u53d1\u751f\u7c98\u5305\u62c6\u5305\u95ee\u9898\uff0c\u56e0\u6b64\u7c98\u5305\u62c6\u5305\u95ee\u9898\u53ea\u53d1\u751f\u5728TCP\u534f\u8bae\u4e2d\u3002<\/p>\n \u4e0b\u9762\u7528\u4e00\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\u6765\u8bb2\u89e3\u4ec0\u4e48\u662f\u7c98\u5305\u548c\u62c6\u5305\u3002<\/p>\n \u5047\u8bbe\u5ba2\u6237\u7aef\u5411\u670d\u52a1\u7aef\u8fde\u7eed\u53d1\u9001\u4e86\u4e24\u4e2a\u6570\u636e\u5305\uff0c\u7528 packet1 \u548c packet2 \u6765\u8868\u793a\uff0c\u90a3\u4e48\u670d\u52a1\u7aef\u6536\u5230\u7684\u6570\u636e\u53ef\u80fd\u6709\u56db\u79cd\uff1a<\/p>\n (1)\u7b2c\u4e00\u79cd\u60c5\u51b5\uff0c\u670d\u52a1\u7aef\u6309\u987a\u5e8f\u6b63\u5e38\u6536\u5230\u4e24\u4e2a\u5305\uff0c\u5373\u672a\u51fa\u73b0\u7c98\u5305\u548c\u62c6\u5305\u7684\u73b0\u8c61\u3002<\/p>\n <\/p>\n (2)\u7b2c\u4e8c\u79cd\u60c5\u51b5\uff0c\u670d\u52a1\u7aef\u53ea\u6536\u5230\u4e00\u4e2a\u6570\u636e\u5305\uff0c\u7531\u4e8e TCP \u4fdd\u8bc1\u9001\u8fbe\u7684\u7279\u6027\uff0c\u6240\u4ee5\u8fd9\u4e00\u4e2a\u6570\u636e\u5305\u5305\u542b\u4e86\u5ba2\u6237\u7aef\u53d1\u9001\u7684\u4e24\u4e2a\u6570\u636e\u5305\u7684\u4fe1\u606f\uff0c\u8fd9\u79cd\u73b0\u8c61\u5c31\u662f\u7c98\u5305\u3002\u9664\u975e\u5ba2\u6237\u7aef\u53d1\u9001\u7684\u6570\u636e\u5305\u6709\u660e\u786e\u7684\u89c4\u5219\uff0c\u5426\u5219\u670d\u52a1\u7aef\u4e0d\u77e5\u9053\u4e24\u4e2a\u5305\u7684\u754c\u9650\uff0c\u96be\u4ee5\u5904\u7406\u6570\u636e\u3002<\/p>\n <\/p>\n (3)\u7b2c\u4e09\u79cd\u60c5\u51b5\uff0c\u670d\u52a1\u7aef\u6536\u5230\u4e86\u4e09\u4e2a\u6570\u636e\u5305\uff0cPackage1\u6570\u636e\u5305\u88ab\u62c6\u5206\u4e3a\u4e24\u4e2a\u6570\u636e\u5305\uff1aPackage1.1\u548cPackage1.2\uff0c\u8fd9\u79cd\u73b0\u8c61\u5c31\u662f\u62c6\u5305\uff0c\u81f3\u4e8e\u62c6\u5305\u7684\u539f\u56e0\u4e0b\u9762\u4f1a\u8bb2\uff0c\u670d\u52a1\u7aef\u6536\u5230\u62c6\u5f00\u7684\u6570\u636e\u5305\u4e5f\u5f88\u96be\u5904\u7406\u3002<\/p>\n <\/p>\n (4)\u7b2c\u56db\u79cd\u60c5\u51b5\uff0c\u4e00\u4e9b\u5927\u7684\u6570\u636e\u5305\u88ab\u62c6\u5206\u4e3a\u5c0f\u7684\u6570\u636e\u5305\uff0c\u5c0f\u7684\u6570\u636e\u5305\u4e0e\u5176\u4ed6\u6570\u636e\u5305\u7c98\u5728\u4e00\u8d77\uff0c\u8fd9\u79cd\u73b0\u8c61\u662f\u5c06\u4e0a\u9762\u7684\u7c98\u5305\u548c\u62c6\u5305\u7efc\u5408\u5728\u4e00\u5757\u3002<\/p>\n <\/p>\n TCP \u7c98\u5305\u62c6\u5305\u7684\u539f\u56e0<\/strong><\/div>\n TCP \u662f\u4e00\u4e2a\u9762\u5411\u300c\u6d41\u300d\u7684\u534f\u8bae\uff0c\u6240\u8c13\u6d41\u5c31\u662f\u6ca1\u6709\u754c\u9650\u7684\u4e00\u957f\u4e32\u4e8c\u8fdb\u5236\u6570\u636e\u3002TCP \u4f5c\u4e3a\u4f20\u8f93\u5c42\u534f\u8bae\u5e76\u4e0d\u4e86\u89e3\u4e0a\u5c42\u4e1a\u52a1\u6570\u636e\u7684\u5177\u4f53\u542b\u4e49\uff0c\u5b83\u4f1a\u6839\u636eTCP\u7f13\u51b2\u533a\u7684\u5b9e\u9645\u60c5\u51b5\u8fdb\u884c\u6570\u636e\u5305\u7684\u5212\u5206\uff0c\u6240\u4ee5\u5728\u4e1a\u52a1\u4e0a\u8ba4\u4e3a\u662f\u4e00\u4e2a\u5b8c\u6574\u7684\u5305\uff0c\u53ef\u80fd\u4f1a\u88ab TCP \u62c6\u5206\u6210\u591a\u4e2a\u5305\u8fdb\u884c\u53d1\u9001\uff0c\u4e5f\u6709\u53ef\u80fd\u628a\u591a\u4e2a\u5c0f\u7684\u5305\u5c01\u88c5\u6210\u4e00\u4e2a\u5927\u7684\u6570\u636e\u5305\u53d1\u9001\uff0c\u8fd9\u5c31\u4f1a\u51fa\u73b0\u7c98\u5305\u62c6\u5305\u7684\u95ee\u9898\u3002<\/p>\n \u4f8b\u5982\uff0cTCP\u7f13\u51b2\u533a\u662f1024\u4e2a\u5b57\u8282\u5927\u5c0f\uff0c\u5982\u679c\u5e94\u7528\u4e00\u6b21\u8bf7\u6c42\u53d1\u9001\u7684\u6570\u636e\u91cf\u6bd4\u8f83\u5c0f\uff0c\u6ca1\u8fbe\u5230\u7f13\u51b2\u533a\u5927\u5c0f\uff0cTCP\u5219\u4f1a\u5c06\u591a\u4e2a\u8bf7\u6c42\u5408\u5e76\u4e3a\u540c\u4e00\u4e2a\u8bf7\u6c42\u8fdb\u884c\u53d1\u9001\uff0c\u7ad9\u5728\u4e1a\u52a1\u4e0a\u6765\u770b\u8fd9\u5c31\u662f\u300c\u7c98\u5305\u300d;<\/p>\n \u5982\u679c\u5e94\u7528\u4e00\u6b21\u8bf7\u6c42\u53d1\u9001\u7684\u6570\u636e\u91cf\u6bd4\u8f83\u5927\uff0c\u8d85\u8fc7\u4e86\u7f13\u51b2\u533a\u5927\u5c0f\uff0cTCP\u5c31\u4f1a\u5c06\u5176\u62c6\u5206\u4e3a\u591a\u6b21\u53d1\u9001\uff0c\u8fd9\u5c31\u662f\u300c\u62c6\u5305\u300d\uff0c\u4e5f\u5c31\u662f\u5c06\u4e00\u4e2a\u5927\u7684\u5305\u62c6\u5206\u4e3a\u591a\u4e2a\u5c0f\u5305\u8fdb\u884c\u53d1\u9001\u3002<\/p>\n TCP \u7c98\u5305\u62c6\u5305\u7684\u89e3\u51b3\u65b9\u6cd5<\/strong><\/div>\n TCP \u662f\u9762\u5411\u6d41\u7684\uff0c\u4f1a\u53d1\u751f\u7c98\u5305\u548c\u62c6\u5305\uff0c\u90a3\u4f5c\u4e3a\u5e94\u7528\u7a0b\u5e8f\uff0c\u5982\u4f55\u4ece\u8fd9\u6e90\u6e90\u4e0d\u65ad\u6d8c\u6765\u7684\u6570\u636e\u6d41\u4e2d\u62c6\u5206\u51fa\u6216\u8005\u5408\u5e76\u51fa\u6709\u610f\u4e49\u7684\u4fe1\u606f\u5462?\u901a\u5e38\u4f1a\u6709\u4ee5\u4e0b\u4e00\u4e9b\u5e38\u7528\u7684\u65b9\u6cd5\uff1a<\/p>\n (1)\u53d1\u9001\u7aef\u7ed9\u6bcf\u4e2a\u6570\u636e\u5305\u6dfb\u52a0\u5305\u9996\u90e8\uff0c\u9996\u90e8\u4e2d\u5e94\u8be5\u81f3\u5c11\u5305\u542b\u6570\u636e\u5305\u7684\u957f\u5ea6\uff0c\u8fd9\u6837\u63a5\u6536\u7aef\u5728\u63a5\u6536\u5230\u6570\u636e\u540e\uff0c\u901a\u8fc7\u8bfb\u53d6\u5305\u9996\u90e8\u7684\u957f\u5ea6\u5b57\u6bb5\uff0c\u4fbf\u77e5\u9053\u6bcf\u4e00\u4e2a\u6570\u636e\u5305\u7684\u5b9e\u9645\u957f\u5ea6\u4e86\u3002<\/p>\n \u5982\u4e0b\u56fe\uff0c\u5728\u6bcf\u4e2a\u5305\u524d\u9762\u52a0\u4e0a\u5305\u7684\u5b9e\u9645\u957f\u5ea6\u3002<\/p>\n <\/p>\n (2)\u53d1\u9001\u7aef\u5c06\u6bcf\u4e2a\u6570\u636e\u5305\u5c01\u88c5\u4e3a\u56fa\u5b9a\u957f\u5ea6(\u4e0d\u591f\u7684\u53ef\u4ee5\u901a\u8fc7\u88650\u586b\u5145)\uff0c\u8fd9\u6837\u63a5\u6536\u7aef\u6bcf\u6b21\u4ece\u63a5\u6536\u7f13\u51b2\u533a\u4e2d\u8bfb\u53d6\u56fa\u5b9a\u957f\u5ea6\u7684\u6570\u636e\u5c31\u81ea\u7136\u800c\u7136\u7684\u628a\u6bcf\u4e2a\u6570\u636e\u5305\u62c6\u5206\u5f00\u6765\u3002<\/p>\n \u4e0b\u56fe\u6bcf\u4e2a\u5305\u7684\u56fa\u5b9a\u957f\u5ea6\u4e3a 4\uff0c\u63a5\u6536\u7aef\u5f88\u5bb9\u6613\u8fdb\u884c\u533a\u5206\u3002<\/p>\n <\/p>\n (3)\u53ef\u4ee5\u5728\u6570\u636e\u5305\u4e4b\u95f4\u8bbe\u7f6e\u8fb9\u754c\uff0c\u5982\u6dfb\u52a0\u7279\u6b8a\u7b26\u53f7\uff0c\u8fd9\u6837\uff0c\u63a5\u6536\u7aef\u901a\u8fc7\u8fd9\u4e2a\u8fb9\u754c\u5c31\u53ef\u4ee5\u5c06\u4e0d\u540c\u7684\u6570\u636e\u5305\u62c6\u5206\u5f00\u3002<\/p>\n \u5982\u4e0b\u56fe\uff0c\u5728\u6bcf\u4e2a\u5305\u7684\u540e\u9762\u52a0\u4e0a\u7279\u6b8a\u5b57\u7b26\uff1a\/<\/p>\n <\/p>\n Netty\u6846\u67b6\u89e3\u51b3\u7c98\u5305\u62c6\u5305\u95ee\u9898<\/strong><\/div>\n Netty \u4f5c\u4e3a\u4e00\u6b3e\u9ad8\u6027\u80fd\u7684 Java \u7f51\u7edc\u7f16\u7a0b\u6846\u67b6\uff0c\u4e0d\u4ec5\u662f\u57fa\u4e8e Java NIO \u8fdb\u884c\u4e86\u6df1\u5ea6\u5c01\u88c5\uff0c\u8fd8\u5728\u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u7aef\u4e4b\u95f4\u7684\u6570\u636e\u4f20\u8f93\u4e0a\u505a\u4e86\u6709\u6548\u5904\u7406\u3002<\/p>\n \u524d\u9762\u8bb2\u8fc7 TCP \u4f20\u8f93\u4f1a\u51fa\u73b0\u7c98\u5305\u548c\u62c6\u5305\u7684\u73b0\u8c61\uff0cNetty \u9488\u5bf9\u8fd9\u4e00\u70b9\u5185\u7f6e\u4e86\u591a\u6b3e\u6570\u636e\u6d41\u7f16\u89e3\u7801\u5668\uff0c\u5ba2\u6237\u7aef\u670d\u52a1\u7aef\u6309\u7167\u7ea6\u5b9a\u597d\u7684\u89c4\u5219\u8fdb\u884c\u6570\u636e\u4f20\u8f93\u5373\u53ef\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002<\/p>\n Netty \u63d0\u4f9b\u4e86\u591a\u6b3e\u5f00\u7bb1\u5373\u7528\u7684\u7f16\u89e3\u7801\u5668\uff1a<\/p>\n
\u5c0f\u7ed3<\/strong><\/div>\n TCP \u662f\u4e00\u4e2a\u9762\u5411\u300c\u6d41\u300d\u7684\u534f\u8bae\uff0c\u6240\u8c13\u6d41\u5c31\u662f\u6ca1\u6709\u754c\u9650\u7684\u4e00\u957f\u4e32\u4e8c\u8fdb\u5236\u6570\u636e\u3002\u5728\u5b9e\u9645\u7684\u4f20\u8f93\u8fc7\u7a0b\u4e2d\uff0cTCP \u4f1a\u6839\u636e\u7f51\u7edc\u60c5\u51b5\u5c06\u6570\u636e\u5305\u8fdb\u884c\u62c6\u5206\u6216\u8005\u62fc\u88c5\uff0c\u5982\u679c\u4e1a\u52a1\u6ca1\u6709\u5b9a\u4e49\u4e00\u4e2a\u660e\u786e\u7684\u754c\u9650\u89c4\u5219\uff0c\u5728\u5e94\u7528\u5c42\u7684\u4e1a\u52a1\u4e0a\u5c31\u4f1a\u51fa\u73b0\u7c98\u5305\u62c6\u5305\u7684\u73b0\u8c61\u3002<\/p>\n \u9488\u5bf9 TCP \u7c98\u5305\u62c6\u5305\u7684\u73b0\u8c61\uff0c\u5e38\u89c1\u7684\u89e3\u51b3\u601d\u8def\u5982\u4e0b\uff1a<\/p>\n
\u4e3a\u4e86\u89e3\u51b3\u7c98\u5305\u62c6\u5305\uff0cNetty \u6846\u67b6\u4e5f\u63d0\u4f9b\u4e86\u5f88\u591a\u5f00\u7bb1\u5373\u7528\u7684\u7f16\u89e3\u7801\u5668\uff0c\u6781\u5927\u7b80\u5316\u7f51\u7edc\u7f16\u7a0b\u89e3\u51b3\u6b64\u7c7b\u95ee\u9898\u7684\u96be\u5ea6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":" \u5e73\u65f6\u5927\u5bb6\u5728\u7f51\u7edc\u7f16\u7a0b\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u4f1a\u9047\u5230\u8fd9\u6837\u4e00\u79cd\u73b0\u8c61\uff1a\u5ba2\u6237\u7aef\u53d1\u9001\u4e86\u4e00\u957f\u4e32\u6d88\u606f\uff0c\u670d\u52a1\u7aef\u63a5\u53d7\u7684\u6d88\u606f\u63c9\u5728\u4e00\u8d77\u6216\u8005\u88ab\u62c6\u5206\u4e86\uff0c […]<\/p>\n","protected":false},"author":1329,"featured_media":241928,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-241917","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/241917","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1329"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=241917"}],"version-history":[{"count":3,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/241917\/revisions"}],"predecessor-version":[{"id":241929,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/241917\/revisions\/241929"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/241928"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=241917"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=241917"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=241917"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}} |