{"id":249064,"date":"2022-08-08T09:00:20","date_gmt":"2022-08-08T01:00:20","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=249064"},"modified":"2022-07-30T22:31:04","modified_gmt":"2022-07-30T14:31:04","slug":"netty-alpha-linux","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/netty-alpha-linux.html","title":{"rendered":"Netty 5.0.0.Alpha4 \u6b63\u5f0f\u53d1\u5e03"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nNetty 5.0.0.Alpha4 \u5df2\u53d1\u5e03\uff0c\u6b64\u7248\u672c\u5220\u9664\u4e86\u5927\u91cf\u91cd\u590d\u4ee3\u7801\uff0c\u5e76\u5bf9 API \u8fdb\u884c\u4e86\u6e05\u7406\u3002\u9664\u6b64\u4e4b\u5916\u8fd8\u589e\u52a0\u4e86\u5728\u4f7f\u7528 JDK NIO \u5b9e\u73b0\u65f6\uff0c\u5bf9 Unix Domain Socket \u7684\u652f\u6301\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/a><\/p>\n

\u4e3b\u8981\u53d8\u5316<\/strong><\/span><\/div>\n
  • \u652f\u6301\u521b\u5efa\u5305\u542b ProtocolFamily \u7684\u6240\u6709 SocketChannel \u548c DatagramChannel \u5b9e\u73b0\u3002ProtocolFamily \u4f1a\u5f71\u54cd\u50cf\u662f\u5426\u5e94\u8be5\u4f7f\u7528 Unix Domain Socket \u8fd9\u6837\u7684\u60c5\u51b5\uff0c\u4e0d\u8fc7\u5b83\u4e5f\u5141\u8bb8\u5220\u9664<\/li>\n
  • Domain*Channel \u7684\u5b9e\u73b0\uff0c\u4f7f\u4e8b\u60c5\u53d8\u5f97 \u201c\u4e00\u81f4\u201d<\/li>\n
  • \u5c06 ChannelOption.RECVBUF_ALLOCATOR \u66f4\u540d\u4e3a RECVBUFFER_ALLOCATOR<\/li>\n
  • \u652f\u6301 JDK \u7684 Unix Domain Socket<\/li>\n
  • \u5c06 EventLoop \/ IoHandler \u66f4\u6539\u4e3a take \/ IoHandle \u8fdb\u884c\u6ce8\u518c\uff0c\u4ee5\u4fbf\u5c06\u6765\u53ef\u4ee5\u5c06\u5176\u4ed6\u4e1c\u897f\u800c\u4e0d\u662f Channel \u6ce8\u518c\u5230 EventLoop \u4e2d<\/li>\n
  • \u6e05\u7406 RecvBufferAllocator<\/li>\n
  • \u4fee\u590d\u5728 macOS \u672c\u5730\u5b9e\u73b0\u4e2d\u7684 disconnect () \u5b9e\u73b0<\/li>\n
  • \u7528 java Locks \u66ff\u4ee3 synchronized\uff0c\u4ee5\u66f4\u597d\u5730\u652f\u6301 Loom<\/li>\n

    \u516c\u544a\u5199\u9053\uff0c\u4e3a\u4e86\u8ba9\u5f00\u53d1\u8005\u80fd\u591f\u5728\u4f7f\u7528 4.1 \u7684\u540c\u65f6\u5c1d\u8bd5\u4f53\u9a8c Netty 5\uff0c\u5f00\u53d1\u56e2\u961f\u9009\u62e9\u5c06\u4e24\u4e2a\u7248\u672c\u653e\u5230\u4e0d\u540c\u7684\u5305\uff0c\u4ee5\u4fbf\u5b83\u4eec\u5171\u5b58\u3002\u56e0\u4e3a\u8fd9\u662f\u4e00\u4e2a\u65b0\u7684\u4e3b\u8981\u7248\u672c\uff0c\u6240\u4ee5\u4f1a\u5305\u542b\u8bb8\u591a\u7834\u574f\u6027\u7684\u53d8\u5316\uff0c\u8fd9\u4e9b\u53d8\u5316\u4e3b\u8981\u53d7 Netty 4.1.x \u751f\u547d\u5468\u671f\u6c72\u53d6\u7684\u7ecf\u9a8c\u5f71\u54cd\u3002<\/p>\n

    \u63a5\u4e0b\u6765\uff0c\u5f00\u53d1\u56e2\u961f\u4f1a\u5c06 Netty \u7684\u9ed8\u8ba4\u5206\u652f\u66f4\u6539\u4e3a main\uff0c\u56e0\u6b64\u5bf9 4.1 \u7248\u672c\u6240\u80fd\u63a5\u53d7\u7684\u53d8\u5316\u4f1a\u66f4\u52a0\u4e25\u683c\uff0c\u6b64\u4e3e\u4e3b\u8981\u662f\u4e3a\u4e86\u4fdd\u8bc1 4.1 \u7248\u672c\u56de\u6eda\u7684\u53ef\u80fd\u6027\u4e0b\u964d\u5230\u6700\u4f4e\u3002\u5f53\u7136\uff0c\u91cd\u8981\u7684\u9519\u8bef\u4fee\u590d\u4e5f\u4f1a\u88ab\u79fb\u690d\u5230 4.1\u3002\u7efc\u4e0a\u6240\u8ff0\uff0c\u5f00\u53d1\u56e2\u961f\u76ee\u524d\u6ca1\u6709\u8ba1\u5212\u505c\u6b62\u5bf9 4.1.x \u7684\u652f\u6301\uff0c\u800c\u662f\u540c\u65f6\u652f\u6301 Netty 5 \u548c 4.1.x\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

    \u652f\u6301\u521b\u5efa\u5305\u542b ProtocolFamily \u7684\u6240\u6709 SocketChannel \u548c DatagramChann […]<\/p>\n","protected":false},"author":1482,"featured_media":7941,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[21],"tags":[],"class_list":["post-249064","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/249064","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\/1482"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=249064"}],"version-history":[{"count":5,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/249064\/revisions"}],"predecessor-version":[{"id":249157,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/249064\/revisions\/249157"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/7941"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=249064"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=249064"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=249064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}