{"id":1702,"date":"2015-01-08T05:38:30","date_gmt":"2015-01-07T21:38:30","guid":{"rendered":"http:\/\/blog.qdac.cc\/?p=1702"},"modified":"2015-01-08T05:38:54","modified_gmt":"2015-01-07T21:38:54","slug":"%e3%80%90diocp-demo%e8%af%b4%e6%98%8e%e3%80%91%e6%89%80%e6%9c%89%e6%bc%94%e7%a4%bademo%e7%9a%84%e7%ae%80%e8%a6%81%e8%af%b4%e6%98%8e","status":"publish","type":"post","link":"https:\/\/blog.qdac.cc\/?p=1702","title":{"rendered":"\u3010DIOCP-DEMO\u8bf4\u660e\u3011\u6240\u6709\u6f14\u793aDEMO\u7684\u7b80\u8981\u8bf4\u660e"},"content":{"rendered":"<p>samples\u76ee\u5f55\u4e0b\u9762\u4e3a\u81ea\u5e26\u7684DEMO<\/p>\n<p>\u53d1\u73b0\u6709\u5f88\u591a\u670b\u53cb\u4e0d\u77e5\u9053\u5982\u4f55\u5f00\u59cbDIOCP\uff0c\u4e0b\u9762\u662fDEMO\u7684\u7b80\u5355\u8bf4\u660e\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u6709\u7528<\/p>\n<p>C#\\Simple<br \/>&nbsp; \u7528C#\u5199\u7684\u4e00\u4e2a\u7b80\u5355\u7684\u56de\u4f20\u6d4b\u8bd5\uff0c\u670d\u52a1\u7aef\u5f00\u542fECHO\u670d\u52a1\u5668\u5373\u53ef<br \/>&nbsp; <br \/>samples\\ECHO<br \/>&nbsp; IOCP\u56de\u5c04\u6d4b\u8bd5\uff0c\u5728\u670d\u52a1\u7aef\u6536\u5230\u6570\u636e\u540e\u7acb\u5373\u53d1\u9001\u56de\u5ba2\u6237\u7aef\uff0c<br \/>&nbsp; \u53ef\u4ee5\u4ece\u8fd9\u4e2aDEMO\u770b\u51fa\u5982\u4f55\u5728\u670d\u52a1\u7aef\u63a5\u6536\u6570\u636e\uff0c\u8fd4\u56de\u6570\u636e\u3002<br \/>&nbsp; <br \/>samples\\iocpTask<br \/>&nbsp; iocpTask\u6f14\u793aDEMO\uff0c\u5f02\u6b65\u4efb\u52a1\u6267\u884cDEMO\uff0c<br \/>&nbsp; \u53ef\u4ee5\u5728\u8be5DEMO\u4e2d\u5b66\u5230\uff0c\u5982\u4f55\u6295\u9012\u4efb\u52a1\u8ba9\u4e3b\u7ebf\u7a0b\u53bb\u6267\u884c(\u8bbf\u95eeUI\u6700\u597d\u5728\u4e3b\u7ebf\u7a0b\u8bbf\u95ee)\u3002<br \/>&nbsp; \u53ef\u4ee5\u5b66\u5230\u5982\u679c\u6ce8\u518c\u4fe1\u53f7\u4efb\u52a1\uff0c\u5982\u4f55\u89e6\u53d1\u4fe1\u53f7\u4efb\u4f55\uff0c\u5982\u4f55\u53cd\u6ce8\u518c\u4fe1\u53f7\u3002<br \/>&nbsp;&nbsp;&nbsp; \u4fe1\u53f7\u4efb\u52a1\u53ef\u4ee5\u5728\u4e00\u4e2a\u4f4d\u7f6e\u8fdb\u884c\u6ce8\u518c\uff0c\u5728\u5b50\u7ebf\u7a0b\u4e2d\u901a\u8fc7\u4fe1\u53f7\u8fdb\u884c\u89e6\u53d1\uff0c\u53ef\u4ee5\u6709\u6548\u7684\u8fdb\u884c\u89e3\u8026\u4f60\u7684\u4ee3\u7801\u3002<br \/>&nbsp; \u66f4\u591a\u7684\u529f\u80fd\u53ef\u4ee5\u4f7f\u7528QDAC3\u4e2d\u7684QWorkers<br \/>&nbsp; <\/p>\n<p>samples\\qdac3-source<br \/>&nbsp; qdac3\u9879\u76ee\u6e90\u7801, \u4f18\u79c0\u7684\u5f00\u6e90\u9879\u76ee\uff0c\u4f60\u53ef\u4ee5\u66f4\u65b0\u5230qdac\u9879\u76ee\u4e2d\u53bb\u66f4\u65b0\u6700\u65b0\u7248\uff0c<br \/>&nbsp; \u4e00\u4e9bDEMO\u4e2d\u6709\u4f7f\u7528\u5230\u3002<br \/>&nbsp; <br \/>samples\\safeLogger<br \/>&nbsp; SafeLogger\u7684\u4f7f\u7528DEMO\uff0c<br \/>&nbsp; \u53ef\u4ee5\u5728\u8be5DEMO\u4e2d\u5b66\u4e60\u5230\u5982\u4f55\u4f7f\u7528SafeLogger\u5c06\u65e5\u5fd7\u663e\u793a\u5230MEMO\uff0c<br \/>&nbsp; \u5982\u4f55\u4f7f\u7528SafeLogger\u5c06\u65e5\u5fd7\u8bb0\u5f55\u5230\u6587\u4ef6\u3002<br \/>&nbsp; <br \/>samples\\simple<br \/>&nbsp; \u6700\u7b80\u5355\u7684DIOCP\u4f7f\u7528\u4f8b\u5b50<br \/>&nbsp; \u5ba2\u6237\u7aef\u91c7\u7528\u963b\u585e\u6a21\u5f0f\uff0c\u53d1\u9001\u6570\u636e\u5230\u670d\u52a1\u7aef\uff0c\u7136\u540e\u670d\u52a1\u7aef\u81ea\u5df1\u8fd4\u56de\uff0c\u5ba2\u6237\u7aef\u7b49\u5f85\u63a5\u6536\u6570\u636e.<br \/>&nbsp; <br \/>=================================================================================<br \/>samples\\socket-Coder<br \/>&nbsp; \u7f16\u7801\u5668\u65b9\u5f0f\u7684DEMO,\u7f16\u7801\u5668\u6a21\u5f0f\u7684\u5b58\u5728\u53ef\u4ee5\u8ba9\u5927\u5bb6\u5728\u4f7f\u7528DEMO\u7684\u65f6\u5019\u76f4\u63a5\u4f20\u9012\u5bf9\u8c61\uff0c\u800c\u4e0d\u7528\u4f60\u53bb\u5904\u7406\u7c98\u5305\u95ee\u9898\uff0c<br \/>&nbsp; \u7f16\u7801\u5668\u6a21\u5f0f\u5728\u89e3\u7801\u6210\u529f\u540e\u5c06\u63a5\u6536\u5230\u7684\u5bf9\u8c61\u6295\u9012\u5230iocpTask\/qworkers\u7684\u7ebf\u7a0b\u4e2d\u53bb\u6267\u884c\uff0c\u8fd9\u6837\u4e0d\u4f1a\u963b\u585ediocp\u7684\u901a\u4fe1\u7ebf\u7a0b\uff0c\u5373\u4f7f\u5728\u5904\u7406\u590d\u6742\u7684\u4e1a\u52a1\u903b\u8f91\uff0c\u4e5f\u4e0d\u5f71\u54cd\u5230\u6570\u636e\u7684\u63a5\u6536\u548c\u53d1\u9001\u3002<br \/>&nbsp; <br \/>samples\\socket-Coder\\diocpCoders<br \/>&nbsp; \u5e38\u7528\u7684\u4e00\u4e9b\u7f16\u7801\u548c\u89e3\u7801\u5668,<br \/>&nbsp; JsonStream: \u5305\u542b\u4e00\u4e2aJson\u548c\u4e00\u4e2aStream&nbsp; <br \/>&nbsp; TStream : \u901a\u7528\u7b80\u5355\u7684TStream\u5bf9\u8c61\uff0c\u5934\u6807\u8bb0 + CRC + \u6570\u636e\u957f\u5ea6 + \u6570\u636e<br \/>&nbsp; TMsgPackCoder: msgpack\u5bf9\u8c61\u3002\u4f7f\u7528Qmsgpack\u8fdb\u884c\u89e3\u6790<br \/>&nbsp; <br \/>&nbsp; \u63a8\u8350\u642d\u5efa\u4f7f\u7528TStream\u7684\u7f16\u7801\u548c\u89e3\u7801\u6a21\u5f0f\uff0c\u56e0\u4e3a\u5f88\u591a\u5bf9\u8c61\u90fd\u80fd\u5e8f\u5217\u5316\u5230\u6d41\u548c\u4ece\u6d41\u4e2d\u8fd8\u539f\u3002<br \/>&nbsp; \u4f8b\u5982 msgpack -&gt; TStream -&gt; diocp -&gt; TStream -&gt;msgpack<br \/>&nbsp; <br \/>samples\\socket-Coder\\StreamCoder<br \/>&nbsp; Stream\u7f16\u7801\u5668\u6a21\u5f0f\u4f8b\u5b50\u3002<br \/>&nbsp; \u53ef\u4ee5\u5728\u8be5DEMO\u4e2d\u5b66\u4e60\u5230\u5982\u679c\u76f4\u63a5\u53d1\u9001\u4e00\u4e2aTStream\u5bf9\u8c61,\u5982\u4f55\u5728\u670d\u52a1\u7aef\u4e2d\u63a5\u6536\u5230\u5230\u8fd9\u4e2a\u5bf9\u8c61\uff0c\u5982\u679c\u5c06\u4e00\u4e2aStream\u5bf9\u8c61\u63a8\u9001\u7ed9\u5ba2\u6237\u7aef\u3002<br \/>&nbsp; \u53ef\u4ee5\u5728\u8be5DEMO\u5b66\u4e60\u5230iocpCoderClient(\u5ba2\u6237\u7aefiocp)\u7684\u4f7f\u7528\u3002<br \/>&nbsp; \u5ba2\u6237\u7aef\u6709\u963b\u585e\u6a21\u5f0f(RawTcpClient)\u548c\u5f02\u6b65\u63a5\u53d7(Client)\u6a21\u5f0f\u3002<br \/>&nbsp; <br \/>samples\\socket-Coder\\DataModuleDEMO-Andriod<br \/>&nbsp; \u624b\u673aAndriod\u5ba2\u6237\u7aef\u4e0ediocp\u670d\u52a1\u5668\u4ea4\u6362\u6570\u636e\u7684\u4f8b\u5b50<br \/>&nbsp; \u53ef\u4ee5\u5b66\u4e60\u5230\u5982\u4f55\u5728andriod\u4e2d\u8bf7\u6c42diocp\u6267\u884csql\u8bed\u53e5\u8fd4\u56de\u4e00\u4e2aTClientDataSet\u7684\u6570\u636e\uff0c\u5e76\u5728\u624b\u673a\u4e0a\u8fdb\u884c\u663e\u793a<br \/>&nbsp; <br \/>samples\\socket-Coder\\DataModuleDEMO<br \/>&nbsp; \u4e09\u5c42\u6570\u636e\u6f14\u793a<br \/>&nbsp; \u53ef\u4ee5\u5b66\u4e60\u5230\u5982\u4f55\u5728\u5ba2\u6237\u7aef\u4e2d\u8bf7\u6c42diocp\u6267\u884csql\u8bed\u53e5\u8fd4\u56de\u4e00\u4e2aTClientDataSet\u7684\u6570\u636e\uff0c\u5e76\u5728\u5ba2\u6237\u7aef\u8fdb\u884c\u663e\u793a<br \/>samples\\socket-Coder\\DataModuleDEMO-SimpleMsgPack<br \/>&nbsp; \u4f7f\u7528simpleMsgPack\u4ee3\u66ffQMsgPack\uff0c\u53ef\u4ee5\u5728D7\u4e2d\u4f7f\u7528<br \/>&nbsp; <br \/>samples\\socket-Coder\\DIOCPFileSERVER<br \/>&nbsp; \u6f14\u793aDIOCP\u5982\u4f55\u4f5c\u4e3a\u6587\u4ef6\u670d\u52a1\u5668\u4f7f\u7528<br \/>&nbsp; \u53ef\u4ee5\u5b66\u4e60\u5230\u5982\u679c\u5206\u5757\u4e0a\u4f20\u6587\u4ef6\u548c\u4e0b\u8f7d\u6587\u4ef6<\/p>\n","protected":false},"excerpt":{"rendered":"<p>samples\u76ee\u5f55\u4e0b\u9762\u4e3a\u81ea\u5e26\u7684DEMO  [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","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":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[43],"tags":[285,292],"class_list":["post-1702","post","type-post","status-publish","format-standard","hentry","category-diocp3","tag-delphi-iocp","tag-diocp3"],"views":3738,"_links":{"self":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/1702","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1702"}],"version-history":[{"count":1,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/1702\/revisions"}],"predecessor-version":[{"id":1703,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/1702\/revisions\/1703"}],"wp:attachment":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1702"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1702"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1702"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}