{"id":112487,"date":"2026-10-03T20:25:02","date_gmt":"2026-10-03T12:25:02","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/112487.html"},"modified":"2026-10-03T20:25:02","modified_gmt":"2026-10-03T12:25:02","slug":"%e6%8b%92%e7%bb%9d%e7%b2%98%e5%8c%85%ef%bc%81%e5%9f%ba%e4%ba%8e-c-%e6%89%8b%e6%8a%8a%e6%89%8b%e5%b8%a6%e4%bd%a0%e5%ae%9e%e7%8e%b0%e4%b8%80%e4%b8%aa%e8%87%aa%e5%ae%9a%e4%b9%89-lv-%e5%8d%8f%e8%ae%ae","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/112487.html","title":{"rendered":"\u62d2\u7edd\u7c98\u5305\uff01\u57fa\u4e8e C++ \u624b\u628a\u624b\u5e26\u4f60\u5b9e\u73b0\u4e00\u4e2a\u81ea\u5b9a\u4e49 LV \u534f\u8bae"},"content":{"rendered":"<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"%E4%B8%BA%E4%BB%80%E4%B9%88%E9%9C%80%E8%A6%81%E8%BF%99%E4%B8%AA%E5%8D%8F%E8%AE%AE%EF%BC%9F%EF%BC%88%E8%A7%A3%E5%86%B3%E7%B2%98%E5%8C%85%EF%BC%89-toc\" style=\"margin-left:0px\">\u4e3a\u4ec0\u4e48\u9700\u8981\u8fd9\u4e2a\u534f\u8bae&#xff1f;&#xff08;\u89e3\u51b3\u7c98\u5305&#xff09;<\/p>\n<p id=\"%E6%8B%86%E8%A7%A3%E2%80%9C%E5%BF%AB%E9%80%92%E9%9D%A2%E5%8D%95%E2%80%9D%20%EF%BC%88%E5%8D%8F%E8%AE%AE%E7%BB%93%E6%9E%84%EF%BC%89-toc\" style=\"margin-left:0px\">\u62c6\u89e3\u201c\u5feb\u9012\u9762\u5355\u201d &#xff08;\u534f\u8bae\u7ed3\u6784&#xff09;<\/p>\n<p id=\"1.%20Length%EF%BC%88%E6%80%BB%E9%95%BF%E5%BA%A6%EF%BC%89%E2%80%94%E2%80%94%204%E5%AD%97%E8%8A%82%EF%BC%88%E5%9B%BA%E5%AE%9A%EF%BC%89-toc\" style=\"margin-left:120px\">1. Length&#xff08;\u603b\u957f\u5ea6&#xff09;\u2014\u2014 4\u5b57\u8282&#xff08;\u56fa\u5b9a&#xff09;<\/p>\n<p id=\"2.%20MType%EF%BC%88%E6%B6%88%E6%81%AF%E7%B1%BB%E5%9E%8B%EF%BC%89%E2%80%94%E2%80%94%204%E5%AD%97%E8%8A%82%EF%BC%88%E5%9B%BA%E5%AE%9A%EF%BC%89-toc\" style=\"margin-left:120px\">2. MType&#xff08;\u6d88\u606f\u7c7b\u578b&#xff09;\u2014\u2014 4\u5b57\u8282&#xff08;\u56fa\u5b9a&#xff09;<\/p>\n<p id=\"3.%20IDLength%EF%BC%88ID%E9%95%BF%E5%BA%A6%EF%BC%89%E2%80%94%E2%80%94%204%E5%AD%97%E8%8A%82%EF%BC%88%E5%9B%BA%E5%AE%9A%EF%BC%89-toc\" style=\"margin-left:120px\">3. IDLength&#xff08;ID\u957f\u5ea6&#xff09;\u2014\u2014 4\u5b57\u8282&#xff08;\u56fa\u5b9a&#xff09;<\/p>\n<p id=\"4.%20MID%EF%BC%88%E6%B6%88%E6%81%AFID%EF%BC%89%E2%80%94%E2%80%94%20%E9%95%BF%E5%BA%A6%E5%8F%AF%E5%8F%98-toc\" style=\"margin-left:120px\">4. MID&#xff08;\u6d88\u606fID&#xff09;\u2014\u2014 \u957f\u5ea6\u53ef\u53d8<\/p>\n<p id=\"5.%20Body%EF%BC%88%E6%B6%88%E6%81%AF%E4%BD%93%EF%BC%89%E2%80%94%E2%80%94%20%E9%95%BF%E5%BA%A6%E5%8F%AF%E5%8F%98-toc\" style=\"margin-left:120px\">5. Body&#xff08;\u6d88\u606f\u4f53&#xff09;\u2014\u2014 \u957f\u5ea6\u53ef\u53d8<\/p>\n<p id=\"%E5%AE%9E%E6%88%98%E6%BC%94%E7%BB%83%20%E2%80%94%E2%80%94%20%E6%8E%A5%E6%94%B6%E6%96%B9%E5%A6%82%E4%BD%95%E6%8B%86%E5%8C%85%E8%A3%B9%EF%BC%9F-toc\" style=\"margin-left:0px\">\u5b9e\u6218\u6f14\u7ec3 \u2014\u2014 \u63a5\u6536\u65b9\u5982\u4f55\u62c6\u5305\u88f9&#xff1f;<\/p>\n<p id=\"%E4%BB%A3%E7%A0%81%E5%AE%9E%E6%88%98%20%E2%80%94%E2%80%94%20%E6%80%8E%E4%B9%88%E6%89%93%E5%8C%85%EF%BC%8C%E6%80%8E%E4%B9%88%E6%8B%86%E5%8C%85%EF%BC%9F-toc\" style=\"margin-left:0px\">\u4ee3\u7801\u5b9e\u6218 \u2014\u2014 \u600e\u4e48\u6253\u5305&#xff0c;\u600e\u4e48\u62c6\u5305&#xff1f;<\/p>\n<p id=\"%E7%AC%AC%E4%B8%80%E6%AD%A5%EF%BC%9A%E6%98%8E%E7%A1%AE%E5%9B%BE%E7%89%87%E9%87%8C%E7%9A%84%E5%8D%8F%E8%AE%AE%E7%BB%93%E6%9E%84-toc\" style=\"margin-left:80px\">\u7b2c\u4e00\u6b65&#xff1a;\u660e\u786e\u56fe\u7247\u91cc\u7684\u534f\u8bae\u7ed3\u6784<\/p>\n<p id=\"%E7%AC%AC%E4%BA%8C%E6%AD%A5%EF%BC%9A%E5%8F%91%E9%80%81%E6%96%B9%E6%89%93%E5%8C%85%EF%BC%88%E6%8B%BC%E5%AD%97%E7%AC%A6%E4%B8%B2%EF%BC%89-toc\" style=\"margin-left:80px\">\u7b2c\u4e8c\u6b65&#xff1a;\u53d1\u9001\u65b9\u6253\u5305&#xff08;\u62fc\u5b57\u7b26\u4e32&#xff09;<\/p>\n<p id=\"%E7%AC%AC%E4%B8%89%E6%AD%A5%EF%BC%9A%E6%8E%A5%E6%94%B6%E6%96%B9%E6%8B%86%E5%8C%85%EF%BC%88%E5%88%87%E5%AD%97%E7%AC%A6%E4%B8%B2%EF%BC%89-toc\" style=\"margin-left:80px\">\u7b2c\u4e09\u6b65&#xff1a;\u63a5\u6536\u65b9\u62c6\u5305&#xff08;\u5207\u5b57\u7b26\u4e32&#xff09;<\/p>\n<p id=\"%E7%AC%AC%E5%9B%9B%E6%AD%A5%EF%BC%9A%E8%A7%A3%E5%86%B3%E7%B2%98%E5%8C%85%E5%92%8C%E5%8D%8A%E5%8C%85%EF%BC%88%E6%A0%B8%E5%BF%83%E4%B8%AD%E7%9A%84%E6%A0%B8%E5%BF%83%EF%BC%89-toc\" style=\"margin-left:80px\">\u7b2c\u56db\u6b65&#xff1a;\u89e3\u51b3\u7c98\u5305\u548c\u534a\u5305&#xff08;\u6838\u5fc3\u4e2d\u7684\u6838\u5fc3&#xff09;<\/p>\n<p id=\"%E7%AC%AC%E4%BA%94%E6%AD%A5%EF%BC%9A%E5%AE%8C%E6%95%B4%E6%B5%8B%E8%AF%95%EF%BC%88%E6%8A%8A%E5%89%8D%E9%9D%A2%E7%9A%84%20pack%20%E5%92%8C%20unpack%20%E9%83%BD%E6%8B%BC%E8%B5%B7%E6%9D%A5%EF%BC%89-toc\" style=\"margin-left:80px\">\u7b2c\u4e94\u6b65&#xff1a;\u5b8c\u6574\u6d4b\u8bd5&#xff08;\u628a\u524d\u9762\u7684 pack \u548c unpack \u90fd\u62fc\u8d77\u6765&#xff09;<\/p>\n<hr id=\"hr-toc\" \/>\n<p>\u9996\u5148&#xff0c;\u6211\u4eec\u628a\u8fd9\u4e2a\u8fc7\u7a0b\u60f3\u8c61\u6210\u201c\u5bc4\u5feb\u9012\u201d\u3002\u7f51\u7edc\u901a\u4fe1\u5c31\u50cf\u662f\u4e00\u6761\u4f20\u9001\u5e26&#xff0c;\u53d1\u9001\u65b9\u8981\u628a\u4e1c\u897f\u4f20\u7ed9\u63a5\u6536\u65b9&#xff0c;\u4f46\u4f20\u9001\u5e26\u662f\u8fde\u7eed\u4e0d\u65ad\u7684&#xff0c;\u63a5\u6536\u65b9\u600e\u4e48\u77e5\u9053\u54ea\u4e00\u5806\u4e1c\u897f\u662f\u4e00\u4e2a\u5b8c\u6574\u7684\u5305\u88f9\u5462&#xff1f;<\/p>\n<p>\u8fd9\u4e2a\u534f\u8bae\u5c31\u662f\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u800c\u8bbe\u8ba1\u7684\u201c\u5feb\u9012\u9762\u5355\u89c4\u8303\u201d<\/p>\n<h2 id=\"%E4%B8%BA%E4%BB%80%E4%B9%88%E9%9C%80%E8%A6%81%E8%BF%99%E4%B8%AA%E5%8D%8F%E8%AE%AE%EF%BC%9F%EF%BC%88%E8%A7%A3%E5%86%B3%E7%B2%98%E5%8C%85%EF%BC%89\" style=\"background-color:transparent\">\u4e3a\u4ec0\u4e48\u9700\u8981\u8fd9\u4e2a\u534f\u8bae&#xff1f;&#xff08;\u89e3\u51b3\u7c98\u5305&#xff09;<\/h2>\n<p>\u5047\u8bbe\u4f60\u5728\u7f51\u4e0a\u4e70\u4e86\u4e24\u4ef6\u5546\u54c1&#xff0c;\u5546\u5bb6\u7528\u4e24\u4e2a\u7eb8\u7bb1\u88c5\u597d\u53d1\u7ed9\u4f60\u3002 \u4f46\u56e0\u4e3a\u5feb\u9012\u516c\u53f8\u4f20\u9001\u5e26\u7684\u539f\u56e0&#xff0c;\u4f60\u6536\u5230\u7684\u65f6\u5019\u53ef\u80fd\u662f&#xff1a;<\/p>\n<li>\n<p>\u7c98\u5305&#xff1a;\u4e24\u4e2a\u7eb8\u7bb1\u88ab\u80f6\u5e26\u6b7b\u6b7b\u7f20\u5728\u4e00\u8d77&#xff0c;\u53d8\u6210\u4e86\u4e00\u4e2a\u5de8\u5927\u7684\u7bb1\u5b50\u3002<\/p>\n<\/li>\n<li>\n<p>\u534a\u5305&#xff1a;\u4e00\u4e2a\u7bb1\u5b50\u5728\u8def\u4e0a\u7834\u4e86&#xff0c;\u4f60\u5148\u6536\u5230\u4e86\u534a\u4e2a\u7bb1\u5b50&#xff0c;\u7b2c\u4e8c\u5929\u624d\u6536\u5230\u53e6\u5916\u534a\u4e2a\u3002<\/p>\n<\/li>\n<p>\u8ba1\u7b97\u673a\u91cc\u7684 TCP\u534f\u8bae \u5c31\u662f\u8fd9\u6761\u201c\u4f20\u9001\u5e26\u201d\u3002\u5b83\u53ea\u8d1f\u8d23\u628a\u6570\u636e\u6e90\u6e90\u4e0d\u65ad\u5730\u9001\u8fc7\u53bb&#xff0c;\u4f46\u4e0d\u4fdd\u8bc1\u8fb9\u754c\u3002 \u6240\u4ee5&#xff0c;\u6211\u4eec\u9700\u8981\u4e00\u4e2a\u7ea6\u5b9a&#xff1a;\u5728\u6bcf\u4e2a\u7eb8\u7bb1\u7684\u6700\u5916\u9762&#xff0c;\u8d34\u4e00\u5f20\u56fa\u5b9a\u683c\u5f0f\u7684\u201c\u5feb\u9012\u9762\u5355\u201d\u3002 \u53ea\u8981\u770b\u5230\u9762\u5355&#xff0c;\u5c31\u77e5\u9053\u8fd9\u4e2a\u7bb1\u5b50\u6709\u591a\u5927&#xff0c;\u91cc\u9762\u88c5\u7684\u662f\u4ec0\u4e48<\/p>\n<h2 id=\"%E6%8B%86%E8%A7%A3%E2%80%9C%E5%BF%AB%E9%80%92%E9%9D%A2%E5%8D%95%E2%80%9D%20%EF%BC%88%E5%8D%8F%E8%AE%AE%E7%BB%93%E6%9E%84%EF%BC%89\">\u62c6\u89e3\u201c\u5feb\u9012\u9762\u5355\u201d &#xff08;\u534f\u8bae\u7ed3\u6784&#xff09;<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1160\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261003122459-6ac0f41b5ce25.png\" width=\"2864\" \/><\/p>\n<p>\u56fe\u7247\u4e2d\u95f4\u90a3\u4e2a\u957f\u6761\u56fe&#xff0c;\u5c31\u662f\u4e00\u4e2a\u5b8c\u6574\u7684\u201c\u5feb\u9012\u9762\u5355\u201d\u3002\u6211\u4eec\u4ece\u5de6\u5230\u53f3\u770b&#xff1a;<\/p>\n<h5 id=\"1.%20Length%EF%BC%88%E6%80%BB%E9%95%BF%E5%BA%A6%EF%BC%89%E2%80%94%E2%80%94%204%E5%AD%97%E8%8A%82%EF%BC%88%E5%9B%BA%E5%AE%9A%EF%BC%89\">1. Length&#xff08;\u603b\u957f\u5ea6&#xff09;\u2014\u2014 4\u5b57\u8282&#xff08;\u56fa\u5b9a&#xff09;<\/h5>\n<ul>\n<li>\n<p>\u8fd9\u662f\u4ec0\u4e48&#xff1a;\u8fd9\u662f\u9762\u5355\u7684\u7b2c\u4e00\u884c&#xff0c;\u5199\u7740\u201c\u8fd9\u4e2a\u5305\u88f9\u603b\u5171\u6709\u591a\u91cd&#xff08;\u591a\u5c11\u5b57\u8282&#xff09;\u201d\u3002<\/p>\n<\/li>\n<li>\n<p>\u4e3a\u4ec0\u4e48\u56fa\u5b9a4\u5b57\u8282&#xff1a;\u56e0\u4e3a4\u4e2a\u5b57\u8282\u53ef\u4ee5\u8868\u793a\u5f88\u5927\u7684\u6570\u5b57&#xff08;\u6700\u5927\u80fd\u8868\u793a40\u591a\u4ebf&#xff09;&#xff0c;\u8db3\u591f\u63cf\u8ff0\u7edd\u5927\u591a\u6570\u5305\u88f9\u7684\u5927\u5c0f\u4e86\u3002<\/p>\n<\/li>\n<li>\n<p>\u600e\u4e48\u7528&#xff1a;\u63a5\u6536\u65b9\u53ea\u8981\u5148\u8bfb\u8fd94\u4e2a\u5b57\u8282&#xff0c;\u5c31\u77e5\u9053\u201c\u54e6&#xff0c;\u539f\u6765\u540e\u9762\u8fd8\u6709100\u4e2a\u5b57\u8282\u7684\u6570\u636e&#xff0c;\u90a3\u6211\u5c31\u6b7b\u7b49&#xff0c;\u76f4\u5230\u6536\u6ee1100\u4e2a\u5b57\u8282&#xff0c;\u6211\u624d\u7b97\u6536\u5b8c\u8fd9\u4e00\u4e2a\u5305\u88f9\u3002\u201d<\/p>\n<\/li>\n<\/ul>\n<h5 id=\"2.%20MType%EF%BC%88%E6%B6%88%E6%81%AF%E7%B1%BB%E5%9E%8B%EF%BC%89%E2%80%94%E2%80%94%204%E5%AD%97%E8%8A%82%EF%BC%88%E5%9B%BA%E5%AE%9A%EF%BC%89\">2. MType&#xff08;\u6d88\u606f\u7c7b\u578b&#xff09;\u2014\u2014 4\u5b57\u8282&#xff08;\u56fa\u5b9a&#xff09;<\/h5>\n<ul>\n<li>\n<p>\u8fd9\u662f\u4ec0\u4e48&#xff1a;\u8fd9\u662f\u9762\u5355\u7684\u7b2c\u4e8c\u884c&#xff0c;\u5199\u7740\u201c\u8fd9\u4e2a\u5305\u88f9\u662f\u5e72\u4ec0\u4e48\u7528\u7684\u201d\u3002<\/p>\n<\/li>\n<li>\n<p>\u4e3a\u4ec0\u4e48\u9700\u8981&#xff1a;\u56e0\u4e3a\u7f51\u7edc\u901a\u4fe1\u5f88\u590d\u6742&#xff0c;\u6709\u7684\u662f\u8bf7\u6c42\u522b\u4eba\u529e\u4e8b&#xff08;RPC\u8c03\u7528&#xff09;&#xff0c;\u6709\u7684\u662f\u8ba2\u9605\u65b0\u95fb&#xff08;\u53d1\u5e03\/\u8ba2\u9605&#xff09;&#xff0c;\u6709\u7684\u662f\u6ce8\u518c\u670d\u52a1\u3002\u63a5\u6536\u65b9\u62ff\u5230\u5305\u88f9\u540e&#xff0c;\u5f97\u5148\u770b\u7c7b\u578b&#xff0c;\u624d\u77e5\u9053\u8981\u4ea4\u7ed9\u54ea\u4e2a\u90e8\u95e8\u53bb\u5904\u7406\u3002<\/p>\n<\/li>\n<li>\n<p>\u4f8b\u5b50&#xff1a;\u6bd4\u5982 MType&#061;1 \u4ee3\u8868RPC\u8bf7\u6c42&#xff0c;MType&#061;2 \u4ee3\u8868RPC\u54cd\u5e94\u3002<\/p>\n<\/li>\n<\/ul>\n<h5 id=\"3.%20IDLength%EF%BC%88ID%E9%95%BF%E5%BA%A6%EF%BC%89%E2%80%94%E2%80%94%204%E5%AD%97%E8%8A%82%EF%BC%88%E5%9B%BA%E5%AE%9A%EF%BC%89\">3. IDLength&#xff08;ID\u957f\u5ea6&#xff09;\u2014\u2014 4\u5b57\u8282&#xff08;\u56fa\u5b9a&#xff09;<\/h5>\n<ul>\n<li>\n<p>\u8fd9\u662f\u4ec0\u4e48&#xff1a;\u8fd9\u662f\u9762\u5355\u7684\u7b2c\u4e09\u884c&#xff0c;\u5199\u7740\u201c\u6211\u7684\u5feb\u9012\u5355\u53f7\u6709\u591a\u957f\u201d\u3002<\/p>\n<\/li>\n<li>\n<p>\u4e3a\u4ec0\u4e48\u9700\u8981&#xff1a;\u56e0\u4e3a\u540e\u9762\u7684\u201c\u5feb\u9012\u5355\u53f7&#xff08;MID&#xff09;\u201d\u957f\u5ea6\u662f\u4e0d\u56fa\u5b9a\u7684\u3002\u6709\u7684\u5355\u53f7\u957f&#xff0c;\u6709\u7684\u5355\u53f7\u77ed\u3002\u6240\u4ee5\u5fc5\u987b\u5148\u7528\u4e00\u4e2a\u56fa\u5b9a\u76844\u5b57\u8282&#xff0c;\u544a\u8bc9\u63a5\u6536\u65b9\u201c\u5355\u53f7\u5360\u4e86\u591a\u5c11\u4e2a\u5b57\u8282\u201d\u3002<\/p>\n<\/li>\n<\/ul>\n<h5 id=\"4.%20MID%EF%BC%88%E6%B6%88%E6%81%AFID%EF%BC%89%E2%80%94%E2%80%94%20%E9%95%BF%E5%BA%A6%E5%8F%AF%E5%8F%98\">4. MID&#xff08;\u6d88\u606fID&#xff09;\u2014\u2014 \u957f\u5ea6\u53ef\u53d8<\/h5>\n<ul>\n<li>\n<p>\u8fd9\u662f\u4ec0\u4e48&#xff1a;\u8fd9\u662f\u201c\u5feb\u9012\u5355\u53f7\u201d\u3002<\/p>\n<\/li>\n<li>\n<p>\u4f5c\u7528&#xff1a;\u7528\u6765\u552f\u4e00\u6807\u8bc6\u8fd9\u4e00\u4e2a\u5305\u88f9\u3002\u6bd4\u5982\u4f60\u53d1\u4e863\u4e2a\u8bf7\u6c42\u7ed9\u670d\u52a1\u5668&#xff0c;\u670d\u52a1\u5668\u56de\u4e863\u4e2a\u54cd\u5e94&#xff0c;\u4f60\u600e\u4e48\u77e5\u9053\u54ea\u4e2a\u54cd\u5e94\u5bf9\u5e94\u54ea\u4e2a\u8bf7\u6c42&#xff1f;\u5c31\u662f\u9760\u8fd9\u4e2aMID\u6765\u5339\u914d\u7684\u3002<\/p>\n<\/li>\n<li>\n<p>\u957f\u5ea6&#xff1a;\u7531\u524d\u9762\u7684 IDLength \u51b3\u5b9a\u3002\u6bd4\u5982 IDLength&#061;8&#xff0c;\u90a3\u8fd9\u91cc\u5c31\u53608\u4e2a\u5b57\u8282\u3002<\/p>\n<\/li>\n<\/ul>\n<h5 id=\"5.%20Body%EF%BC%88%E6%B6%88%E6%81%AF%E4%BD%93%EF%BC%89%E2%80%94%E2%80%94%20%E9%95%BF%E5%BA%A6%E5%8F%AF%E5%8F%98\">5. Body&#xff08;\u6d88\u606f\u4f53&#xff09;\u2014\u2014 \u957f\u5ea6\u53ef\u53d8<\/h5>\n<ul>\n<li>\n<p>\u8fd9\u662f\u4ec0\u4e48&#xff1a;\u8fd9\u662f\u201c\u5305\u88f9\u91cc\u771f\u6b63\u88c5\u7684\u4e1c\u897f\u201d\u3002<\/p>\n<\/li>\n<li>\n<p>\u4f5c\u7528&#xff1a;\u4e5f\u5c31\u662f\u5b9e\u9645\u8981\u4f20\u8f93\u7684\u4e1a\u52a1\u6570\u636e\u3002\u6bd4\u5982\u4f60\u8c03\u7528\u4e00\u4e2a\u201c\u8ba1\u7b97\u52a0\u6cd5\u201d\u7684\u51fd\u6570&#xff0c;Body\u91cc\u5c31\u88c5\u7740 1&#043;1 \u8fd9\u4e2a\u53c2\u6570\u3002<\/p>\n<\/li>\n<li>\n<p>\u957f\u5ea6&#xff1a;\u5b83\u7684\u957f\u5ea6 &#061; \u603b\u957f\u5ea6&#xff08;Length&#xff09; &#8211; \u9762\u5355\u4e0a\u5176\u4ed6\u6240\u6709\u5b57\u6bb5\u7684\u957f\u5ea6<\/p>\n<\/li>\n<\/ul>\n<h2 id=\"%E5%AE%9E%E6%88%98%E6%BC%94%E7%BB%83%20%E2%80%94%E2%80%94%20%E6%8E%A5%E6%94%B6%E6%96%B9%E5%A6%82%E4%BD%95%E6%8B%86%E5%8C%85%E8%A3%B9%EF%BC%9F\" style=\"background-color:transparent\">\u5b9e\u6218\u6f14\u7ec3 \u2014\u2014 \u63a5\u6536\u65b9\u5982\u4f55\u62c6\u5305\u88f9&#xff1f;<\/h2>\n<p>\u5047\u8bbe\u4f60\u662f\u4e00\u4e2a\u63a5\u6536\u65b9&#xff0c;\u6536\u5230\u4e86\u8fd9\u4e32\u6570\u636e&#xff0c;\u4f60\u8be5\u600e\u4e48\u89e3\u6790&#xff1f;<\/p>\n<li>\n<p>\u5148\u8bfb\u524d4\u4e2a\u5b57\u8282&#xff08;Length&#xff09;&#xff1a;\u4f60\u4e00\u770b&#xff0c;\u503c\u662f 100\u3002<\/p>\n<ul>\n<li>\n<p>\u4f60\u7684\u5fc3\u91cc\u6d3b\u52a8&#xff1a;\u597d\u7684&#xff0c;\u8fd9\u4e2a\u5305\u88f9\u603b\u5171\u6709100\u4e2a\u5b57\u8282\u3002\u540e\u9762\u8fd8\u670996\u4e2a\u5b57\u8282&#xff08;\u56e0\u4e3a\u6211\u5df2\u7ecf\u8bfb\u4e864\u4e2a\u4e86&#xff09;\u3002<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u63a5\u7740\u8bfb4\u4e2a\u5b57\u8282&#xff08;MType&#xff09;&#xff1a;\u4f60\u4e00\u770b&#xff0c;\u503c\u662f 1\u3002<\/p>\n<ul>\n<li>\n<p>\u4f60\u7684\u5fc3\u91cc\u6d3b\u52a8&#xff1a;\u54e6&#xff0c;\u8fd9\u662f\u4e00\u4e2aRPC\u8bf7\u6c42&#xff0c;\u6211\u5f97\u51c6\u5907\u53bb\u5904\u7406\u4e1a\u52a1\u903b\u8f91\u3002<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u518d\u8bfb4\u4e2a\u5b57\u8282&#xff08;IDLength&#xff09;&#xff1a;\u4f60\u4e00\u770b&#xff0c;\u503c\u662f 8\u3002<\/p>\n<ul>\n<li>\n<p>\u4f60\u7684\u5fc3\u91cc\u6d3b\u52a8&#xff1a;\u597d\u7684&#xff0c;\u8fd9\u4e2a\u5305\u88f9\u7684\u5355\u53f7\u67098\u4e2a\u5b57\u8282\u957f\u3002<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u63a5\u7740\u8bfb8\u4e2a\u5b57\u8282&#xff08;MID&#xff09;&#xff1a;\u4f60\u8bfb\u5230\u4e86\u5177\u4f53\u7684\u5355\u53f7&#xff0c;\u6bd4\u5982 10086\u3002<\/p>\n<ul>\n<li>\n<p>\u4f60\u7684\u5fc3\u91cc\u6d3b\u52a8&#xff1a;\u8bb0\u4f4f\u8fd9\u4e2a\u5355\u53f7&#xff0c;\u7b49\u4e0b\u56de\u590d\u7684\u65f6\u5019\u8981\u5e26\u4e0a\u3002<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u6700\u540e\u8bfb\u5269\u4e0b\u7684\u6240\u6709\u5b57\u8282&#xff08;Body&#xff09;&#xff1a;\u7b97\u4e00\u4e0b&#xff0c;\u603b\u5171100\u5b57\u8282&#xff0c;\u6211\u5df2\u7ecf\u7528\u4e86 4&#043;4&#043;4&#043;8&#061;20 \u5b57\u8282&#xff0c;\u8fd8\u5269 80 \u5b57\u8282\u3002\u4f60\u5c31\u628a\u8fd980\u4e2a\u5b57\u8282\u5168\u8bfb\u51fa\u6765\u3002<\/p>\n<ul>\n<li>\n<p>\u4f60\u7684\u5fc3\u91cc\u6d3b\u52a8&#xff1a;\u8fd9\u5c31\u662f\u771f\u6b63\u7684\u6570\u636e\u5185\u5bb9\u4e86\u3002<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<p>\u5b8c\u7f8e&#xff01; \u4f60\u6210\u529f\u5730\u4ece\u8fde\u7eed\u4e0d\u65ad\u7684\u7f51\u7edc\u6570\u636e\u6d41\u4e2d&#xff0c;\u7cbe\u51c6\u5730\u5207\u5206\u51fa\u4e86\u5b8c\u6574\u7684\u4e00\u6761\u6d88\u606f<\/p>\n<h2 id=\"%E4%BB%A3%E7%A0%81%E5%AE%9E%E6%88%98%20%E2%80%94%E2%80%94%20%E6%80%8E%E4%B9%88%E6%89%93%E5%8C%85%EF%BC%8C%E6%80%8E%E4%B9%88%E6%8B%86%E5%8C%85%EF%BC%9F\">\u4ee3\u7801\u5b9e\u6218 \u2014\u2014 \u600e\u4e48\u6253\u5305&#xff0c;\u600e\u4e48\u62c6\u5305&#xff1f;<\/h2>\n<h4 id=\"%E7%AC%AC%E4%B8%80%E6%AD%A5%EF%BC%9A%E6%98%8E%E7%A1%AE%E5%9B%BE%E7%89%87%E9%87%8C%E7%9A%84%E5%8D%8F%E8%AE%AE%E7%BB%93%E6%9E%84\">\u7b2c\u4e00\u6b65&#xff1a;\u660e\u786e\u56fe\u7247\u91cc\u7684\u534f\u8bae\u7ed3\u6784<\/h4>\n<p>\u6839\u636e\u56fe\u7247&#xff0c;\u6211\u4eec\u7684\u6570\u636e\u5305\u957f\u8fd9\u6837&#xff1a;<\/p>\n<p>[Length 4\u5b57\u7b26][MType 4\u5b57\u7b26][IDLength 4\u5b57\u7b26][MID \u53d8\u957f][Body \u53d8\u957f] <\/p>\n<ul>\n<li>\n<p>Length&#xff1a;\u540e\u9762\u6240\u6709\u4e1c\u897f\u7684\u603b\u957f\u5ea6&#xff08;\u56fa\u5b9a 4 \u5b57\u7b26&#xff09;<\/p>\n<\/li>\n<li>\n<p>MType&#xff1a;\u6d88\u606f\u7c7b\u578b&#xff08;\u56fa\u5b9a 4 \u5b57\u7b26&#xff09;<\/p>\n<\/li>\n<li>\n<p>IDLength&#xff1a;MID \u7684\u957f\u5ea6&#xff08;\u56fa\u5b9a 4 \u5b57\u7b26&#xff09;<\/p>\n<\/li>\n<li>\n<p>MID&#xff1a;\u6d88\u606f ID&#xff08;\u957f\u5ea6\u7531 IDLength \u51b3\u5b9a&#xff09;<\/p>\n<\/li>\n<li>\n<p>Body&#xff1a;\u6b63\u6587&#xff08;\u5269\u4e0b\u7684\u90fd\u662f\u5b83&#xff09;<\/p>\n<\/li>\n<\/ul>\n<h4 id=\"%E7%AC%AC%E4%BA%8C%E6%AD%A5%EF%BC%9A%E5%8F%91%E9%80%81%E6%96%B9%E6%89%93%E5%8C%85%EF%BC%88%E6%8B%BC%E5%AD%97%E7%AC%A6%E4%B8%B2%EF%BC%89\">\u7b2c\u4e8c\u6b65&#xff1a;\u53d1\u9001\u65b9\u6253\u5305&#xff08;\u62fc\u5b57\u7b26\u4e32&#xff09;<\/h4>\n<p>#include &lt;iostream&gt;<br \/>\n#include &lt;string&gt;<br \/>\nusing namespace std;<\/p>\n<p>\/\/ \u8f85\u52a9\u51fd\u6570&#xff1a;\u628a\u6570\u5b57\u53d8\u6210 4 \u4f4d\u5b57\u7b26\u4e32\u3002\u6bd4\u5982 5 \u53d8\u6210 &#034;0005&#034;<br \/>\nstring to4(int num) {<br \/>\n    string s &#061; to_string(num);<br \/>\n    while (s.length() &lt; 4) s &#061; &#034;0&#034; &#043; s;<br \/>\n    return s;<br \/>\n}<\/p>\n<p>\/\/ \u6253\u5305\u51fd\u6570<br \/>\nstring pack(int mtype, string mid, string body) {<br \/>\n    \/\/ 1. \u7b97 IDLength&#xff08;MID \u7684\u957f\u5ea6&#xff09;<br \/>\n    int idLen &#061; mid.length();<\/p>\n<p>    \/\/ 2. \u7b97 Length&#xff08;\u540e\u9762\u6240\u6709\u4e1c\u897f\u7684\u603b\u957f\u5ea6&#xff09;<br \/>\n    \/\/ \u540e\u9762\u6709&#xff1a;MType(4) &#043; IDLength(4) &#043; MID(idLen) &#043; Body(body.length())<br \/>\n    int length &#061; 4 &#043; 4 &#043; idLen &#043; body.length();<\/p>\n<p>    \/\/ 3. \u6309\u987a\u5e8f\u62fc\u63a5&#xff08;\u8fd9\u5c31\u662f\u6253\u5305&#xff01;&#xff09;<br \/>\n    string packet &#061; to4(length) &#043; to4(mtype) &#043; to4(idLen) &#043; mid &#043; body;<\/p>\n<p>    return packet;<br \/>\n}<\/p>\n<p>int main() {<br \/>\n    \/\/ \u53d1\u9001\u4e00\u6761\u6d88\u606f&#xff1a;\u7c7b\u578b1&#xff0c;ID\u662f&#034;1001&#034;&#xff0c;\u6b63\u6587\u662f&#034;Hello&#034;<br \/>\n    string packet &#061; pack(1, &#034;1001&#034;, &#034;Hello&#034;);<br \/>\n    cout &lt;&lt; &#034;\u6253\u5305\u7ed3\u679c: &#034; &lt;&lt; packet &lt;&lt; endl;<br \/>\n    return 0;<br \/>\n} <\/p>\n<p>\u8fd0\u884c\u7ed3\u679c&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"52\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261003122500-6ac0f41cdf21a.png\" width=\"454\" \/> <\/p>\n<p>\u6211\u4eec\u6765\u62c6\u89e3\u4e00\u4e0b\u8fd9\u4e2a\u7ed3\u679c&#xff1a;<\/p>\n<ul>\n<li>\n<p>0017 \u2192 Length&#xff08;\u540e\u9762\u603b\u5171 17 \u4e2a\u5b57\u7b26&#xff09;<\/p>\n<\/li>\n<li>\n<p>0001 \u2192 MType&#xff08;\u7c7b\u578b 1&#xff09;<\/p>\n<\/li>\n<li>\n<p>0004 \u2192 IDLength&#xff08;MID \u6709 4 \u4e2a\u5b57\u7b26&#xff09;<\/p>\n<\/li>\n<li>\n<p>1001 \u2192 MID<\/p>\n<\/li>\n<li>\n<p>Hello \u2192 Body<\/p>\n<\/li>\n<\/ul>\n<h4 id=\"%E7%AC%AC%E4%B8%89%E6%AD%A5%EF%BC%9A%E6%8E%A5%E6%94%B6%E6%96%B9%E6%8B%86%E5%8C%85%EF%BC%88%E5%88%87%E5%AD%97%E7%AC%A6%E4%B8%B2%EF%BC%89\">\u7b2c\u4e09\u6b65&#xff1a;\u63a5\u6536\u65b9\u62c6\u5305&#xff08;\u5207\u5b57\u7b26\u4e32&#xff09;<\/h4>\n<p>\/*<br \/>\n    \u6a21\u62dfLv\u534f\u8bae<br \/>\n    \u6253\u5305&#xff0c;\u62c6\u5305<br \/>\n*\/<\/p>\n<p>\/*<br \/>\n    \u6570\u636e\u5305\u957f\u8fd9\u6837\u5b50<br \/>\n    [Length 4\u5b57\u7b26][MType 4\u5b57\u7b26][IDLength 4\u5b57\u7b26][MID \u53d8\u957f][Body \u53d8\u957f]<br \/>\n*\/<\/p>\n<p>#include &lt;iostream&gt;<br \/>\n#include &lt;string&gt;<\/p>\n<p>using namespace std;<\/p>\n<p>\/\/ \u8f85\u52a9\u51fd\u6570&#xff0c;\u628a\u6570\u5b57\u8f6c\u5316\u4e3a4\u4e3a\u5b57\u7b26\u4e32&#xff0c;4\u8f6c\u4e3a\u5b57\u7b26\u4e320004<br \/>\nstring to4(int num){<br \/>\n    \/\/ \u8f6c\u6362\u5b57\u7b26\u4e32<br \/>\n    string s &#061; to_string(num);<br \/>\n    while(s.length() &lt; 4){<br \/>\n        \/\/ \u5de6\u8fb9\u88650<br \/>\n        s &#061; &#034;0&#034; &#043; s;<br \/>\n    }<br \/>\n    return s;<br \/>\n}<\/p>\n<p>\/\/ \u6253\u5305\u51fd\u6570<br \/>\nstring pack(int mtype, string mid, string body){<br \/>\n    \/\/ 1\u3001\u7b97IDLength\u957f\u5ea6(MID \u7684\u957f\u5ea6)<br \/>\n    int idLen &#061; mid.size();<\/p>\n<p>    \/\/ 2\u3001\u7b97length&#xff08;\u540e\u9762\u6240\u6709\u4e1c\u897f\u7684\u603b\u957f\u5ea6&#xff09;<br \/>\n    int length &#061; 4 &#043; 4 &#043; idLen &#043; body.size();<\/p>\n<p>    \/\/ 3\u3001\u6309\u987a\u5e8f\u62fc\u63a5&#xff08;\u8fd9\u5c31\u662f\u6253\u5305&#xff09;<br \/>\n    string packet &#061; to4(length) &#043; to4(mtype) &#043; to4(idLen) &#043; mid &#043; body;<\/p>\n<p>    return packet;<br \/>\n}<\/p>\n<p>void unpack(string packet){<br \/>\n    \/\/ 1\u3001\u5207\u9664\u524d4\u4e2a\u5b57\u7b26&#xff0c;\u8fd9\u662fLength<br \/>\n    string lenStr &#061; packet.substr(0,4);<br \/>\n    int length &#061; stoi(lenStr);<\/p>\n<p>    \/\/ 2\u3001\u5207\u9664\u524d4\u4e2a\u5b57\u7b26&#xff0c;\u8fd9\u662fMType<br \/>\n    string mtypeStr &#061; packet.substr(4,4);<br \/>\n    int mtype &#061; stoi(mtypeStr);<\/p>\n<p>    \/\/ 3\u3001\u5207\u9664\u524d4\u4e2a\u5b57\u7b26&#xff0c;\u8fd9\u662fLDLength<br \/>\n    string idLenStr &#061; packet.substr(8,4);<br \/>\n    int idLen &#061; stoi(idLenStr);<\/p>\n<p>    \/\/ 4\u3001\u4ece12\u4e2a\u5b57\u7b26\u5f00\u59cb&#xff0c;\u5207idLen\u4e2a\u5b57\u7b26&#xff0c;\u8fd9\u662fMID<br \/>\n    string mid &#061; packet.substr(12,idLen);<\/p>\n<p>    \/\/ 5. \u5269\u4e0b\u7684\u5168\u662f Body<br \/>\n    string body &#061; packet.substr(12 &#043; idLen);<\/p>\n<p>    \/\/ \u6253\u5370\u7ed3\u679c<br \/>\n    cout &lt;&lt; &#034;\u89e3\u6790\u7ed3\u679c&#xff1a;&#034; &lt;&lt; endl;<br \/>\n    cout &lt;&lt; &#034;  Length &#061; &#034; &lt;&lt; length &lt;&lt; endl;<br \/>\n    cout &lt;&lt; &#034;  MType &#061; &#034; &lt;&lt; mtype &lt;&lt; endl;<br \/>\n    cout &lt;&lt; &#034;  IDLength &#061; &#034; &lt;&lt; idLen &lt;&lt; endl;<br \/>\n    cout &lt;&lt; &#034;  MID &#061; &#034; &lt;&lt; mid &lt;&lt; endl;<br \/>\n    cout &lt;&lt; &#034;  Body &#061; &#034; &lt;&lt; body &lt;&lt; endl;<br \/>\n}<\/p>\n<p>int main()<br \/>\n{<br \/>\n    \/\/ 1\u3001\u53d1\u9001\u65b9\u6253\u5305<br \/>\n    string packet &#061; pack(1, &#034;1001&#034;, &#034;hello&#034;);<br \/>\n    cout &lt;&lt; &#034;\u6253\u5305\u7ed3\u679c&#xff1a;&#034; &lt;&lt; packet &lt;&lt; endl;<\/p>\n<p>    \/\/ 2\u3001\u89e3\u5305<br \/>\n    unpack(packet);<\/p>\n<p>    return 0;<br \/>\n} <\/p>\n<p>\u8fd0\u884c\u7ed3\u679c&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"208\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261003122500-6ac0f41ce86cd.png\" width=\"456\" \/> <\/p>\n<h4 id=\"%E7%AC%AC%E5%9B%9B%E6%AD%A5%EF%BC%9A%E8%A7%A3%E5%86%B3%E7%B2%98%E5%8C%85%E5%92%8C%E5%8D%8A%E5%8C%85%EF%BC%88%E6%A0%B8%E5%BF%83%E4%B8%AD%E7%9A%84%E6%A0%B8%E5%BF%83%EF%BC%89\">\u7b2c\u56db\u6b65&#xff1a;\u89e3\u51b3\u7c98\u5305\u548c\u534a\u5305&#xff08;\u6838\u5fc3\u4e2d\u7684\u6838\u5fc3&#xff09;<\/h4>\n<p>\u73b0\u5b9e\u4e2d&#xff0c;\u7f51\u7edc\u4e0d\u4f1a\u4e56\u4e56\u5730\u4e00\u6761\u4e00\u6761\u53d1\u3002\u6211\u4eec\u7528\u4e00\u4e2a\u5927\u53e3\u888b&#xff08;buffer&#xff09;\u6765\u88c5\u6570\u636e\u3002<\/p>\n<p>string buffer &#061; &#034;&#034;; \/\/ \u5927\u53e3\u888b<\/p>\n<p>\/\/ \u5904\u7406\u53e3\u888b\u91cc\u7684\u6570\u636e<br \/>\nvoid processBuffer() {<br \/>\n    while (true) {<br \/>\n        \/\/ 1. \u53e3\u888b\u91cc\u8fde 4 \u4e2a\u5b57\u7b26&#xff08;Length&#xff09;\u90fd\u4e0d\u591f&#xff0c;\u7b49\u4e0b\u6b21\u5427<br \/>\n        if (buffer.length() &lt; 4) break;<\/p>\n<p>        \/\/ 2. \u5077\u770b\u524d 4 \u4e2a\u5b57\u7b26&#xff0c;\u7b97\u51fa\u6574\u4e2a\u5305\u5e94\u8be5\u6709\u591a\u957f<br \/>\n        int length &#061; stoi(buffer.substr(0, 4));<\/p>\n<p>        \/\/ 3. \u6574\u4e2a\u5305\u7684\u5b9e\u9645\u603b\u957f\u5ea6 &#061; 4&#xff08;Length\u81ea\u5df1&#xff09; &#043; length&#xff08;\u540e\u9762\u7684\u4e1c\u897f&#xff09;<br \/>\n        int totalLen &#061; 4 &#043; length;<\/p>\n<p>        \/\/ 4. \u53e3\u888b\u91cc\u591f\u4e0d\u591f\u4e00\u4e2a\u5b8c\u6574\u7684\u5305&#xff1f;<br \/>\n        if (buffer.length() &gt;&#061; totalLen) {<br \/>\n            \/\/ \u591f\u4e86&#xff01;\u5207\u51fa\u5b8c\u6574\u7684\u5305<br \/>\n            string packet &#061; buffer.substr(0, totalLen);<\/p>\n<p>            \/\/ \u4ece\u53e3\u888b\u91cc\u5220\u6389\u5df2\u7ecf\u5904\u7406\u7684\u90e8\u5206<br \/>\n            buffer.erase(0, totalLen);<\/p>\n<p>            \/\/ \u89e3\u6790\u8fd9\u4e2a\u5305&#xff08;\u7528\u4e0a\u9762\u7684 unpack \u903b\u8f91&#xff09;<br \/>\n            cout &lt;&lt; &#034;\u2705 \u89e3\u6790\u51fa\u4e00\u6761\u5b8c\u6574\u6d88\u606f: &#034; &lt;&lt; packet &lt;&lt; endl;<br \/>\n        } else {<br \/>\n            \/\/ \u4e0d\u591f&#xff01;\u534a\u5305&#xff0c;\u7b49\u4e0b\u6b21\u6570\u636e\u6765<br \/>\n            cout &lt;&lt; &#034;\u23f3 \u6570\u636e\u4e0d\u5b8c\u6574&#xff0c;\u7b49\u5f85\u66f4\u591a\u6570\u636e&#8230;&#034; &lt;&lt; endl;<br \/>\n            break;<br \/>\n        }<br \/>\n    }<br \/>\n}<\/p>\n<p>\/\/ \u6a21\u62df\u7f51\u7edc\u6570\u636e\u5230\u8fbe<br \/>\nvoid onDataReceived(string data) {<br \/>\n    cout &lt;&lt; &#034;&#x1f4e9; \u6536\u5230\u6570\u636e: &#034; &lt;&lt; data &lt;&lt; endl;<br \/>\n    buffer &#043;&#061; data;   \/\/ \u4e22\u8fdb\u53e3\u888b<br \/>\n    processBuffer();  \/\/ \u5c1d\u8bd5\u5904\u7406<br \/>\n} <\/p>\n<h4 id=\"%E7%AC%AC%E4%BA%94%E6%AD%A5%EF%BC%9A%E5%AE%8C%E6%95%B4%E6%B5%8B%E8%AF%95%EF%BC%88%E6%8A%8A%E5%89%8D%E9%9D%A2%E7%9A%84%20pack%20%E5%92%8C%20unpack%20%E9%83%BD%E6%8B%BC%E8%B5%B7%E6%9D%A5%EF%BC%89\" style=\"background-color:transparent\">\u7b2c\u4e94\u6b65&#xff1a;\u5b8c\u6574\u6d4b\u8bd5&#xff08;\u628a\u524d\u9762\u7684 pack \u548c unpack \u90fd\u62fc\u8d77\u6765&#xff09;<\/h4>\n<p>\/*<br \/>\n    \u6a21\u62dfLv\u534f\u8bae<br \/>\n    \u6253\u5305&#xff0c;\u62c6\u5305<br \/>\n*\/<\/p>\n<p>\/*<br \/>\n    \u6570\u636e\u5305\u957f\u8fd9\u6837\u5b50<br \/>\n    [Length 4\u5b57\u7b26][MType 4\u5b57\u7b26][IDLength 4\u5b57\u7b26][MID \u53d8\u957f][Body \u53d8\u957f]<br \/>\n*\/<\/p>\n<p>#include &lt;iostream&gt;<br \/>\n#include &lt;string&gt;<\/p>\n<p>using namespace std;<\/p>\n<p>\/\/ \u8f85\u52a9\u51fd\u6570&#xff0c;\u628a\u6570\u5b57\u8f6c\u5316\u4e3a4\u4e3a\u5b57\u7b26\u4e32&#xff0c;4\u8f6c\u4e3a\u5b57\u7b26\u4e320004<br \/>\nstring to4(int num){<br \/>\n    \/\/ \u8f6c\u6362\u5b57\u7b26\u4e32<br \/>\n    string s &#061; to_string(num);<br \/>\n    while(s.length() &lt; 4){<br \/>\n        \/\/ \u5de6\u8fb9\u88650<br \/>\n        s &#061; &#034;0&#034; &#043; s;<br \/>\n    }<br \/>\n    return s;<br \/>\n}<\/p>\n<p>\/\/ \u6253\u5305\u51fd\u6570<br \/>\nstring pack(int mtype, string mid, string body){<br \/>\n    \/\/ 1\u3001\u7b97IDLength\u957f\u5ea6(MID \u7684\u957f\u5ea6)<br \/>\n    int idLen &#061; mid.size();<\/p>\n<p>    \/\/ 2\u3001\u7b97length&#xff08;\u540e\u9762\u6240\u6709\u4e1c\u897f\u7684\u603b\u957f\u5ea6&#xff09;<br \/>\n    int length &#061; 4 &#043; 4 &#043; idLen &#043; body.size();<\/p>\n<p>    \/\/ 3\u3001\u6309\u987a\u5e8f\u62fc\u63a5&#xff08;\u8fd9\u5c31\u662f\u6253\u5305&#xff09;<br \/>\n    string packet &#061; to4(length) &#043; to4(mtype) &#043; to4(idLen) &#043; mid &#043; body;<\/p>\n<p>    return packet;<br \/>\n}<\/p>\n<p>void unpack(string packet){<br \/>\n    \/\/ 1\u3001\u5207\u9664\u524d4\u4e2a\u5b57\u7b26&#xff0c;\u8fd9\u662fLength<br \/>\n    string lenStr &#061; packet.substr(0,4);<br \/>\n    int length &#061; stoi(lenStr);<\/p>\n<p>    \/\/ 2\u3001\u5207\u9664\u524d4\u4e2a\u5b57\u7b26&#xff0c;\u8fd9\u662fMType<br \/>\n    string mtypeStr &#061; packet.substr(4,4);<br \/>\n    int mtype &#061; stoi(mtypeStr);<\/p>\n<p>    \/\/ 3\u3001\u5207\u9664\u524d4\u4e2a\u5b57\u7b26&#xff0c;\u8fd9\u662fLDLength<br \/>\n    string idLenStr &#061; packet.substr(8,4);<br \/>\n    int idLen &#061; stoi(idLenStr);<\/p>\n<p>    \/\/ 4\u3001\u4ece12\u4e2a\u5b57\u7b26\u5f00\u59cb&#xff0c;\u5207idLen\u4e2a\u5b57\u7b26&#xff0c;\u8fd9\u662fMID<br \/>\n    string mid &#061; packet.substr(12,idLen);<\/p>\n<p>    \/\/ 5. \u5269\u4e0b\u7684\u5168\u662f Body<br \/>\n    string body &#061; packet.substr(12 &#043; idLen);<\/p>\n<p>    \/\/ \u6253\u5370\u7ed3\u679c<br \/>\n    cout &lt;&lt; &#034;\u89e3\u6790\u7ed3\u679c&#xff1a;&#034; &lt;&lt; endl;<br \/>\n    cout &lt;&lt; &#034;  Length &#061; &#034; &lt;&lt; length &lt;&lt; endl;<br \/>\n    cout &lt;&lt; &#034;  MType &#061; &#034; &lt;&lt; mtype &lt;&lt; endl;<br \/>\n    cout &lt;&lt; &#034;  IDLength &#061; &#034; &lt;&lt; idLen &lt;&lt; endl;<br \/>\n    cout &lt;&lt; &#034;  MID &#061; &#034; &lt;&lt; mid &lt;&lt; endl;<br \/>\n    cout &lt;&lt; &#034;  Body &#061; &#034; &lt;&lt; body &lt;&lt; endl;<br \/>\n}<\/p>\n<p>\/\/ \u89e3\u51b3\u7c98\u5305\u548c\u534a\u5305<br \/>\nstring buffer &#061; &#034;&#034;;<\/p>\n<p>\/\/ \u5904\u7406\u53e3\u888b\u91cc\u7684\u6570\u636e<br \/>\nvoid processBuffer(){<br \/>\n    while(true){<br \/>\n        \/\/ 1\u3001\u53e3\u888b\u91cc4\u4e2a\u5b57\u6bb5\u90fd\u4e0d\u591f&#xff0c;\u7b49\u4e0b\u6b21<br \/>\n        if(buffer.length() &lt; 4) break;<\/p>\n<p>        \/\/ 2\u3001\u5077\u770b\u4e00\u4e0b4\u4e2a\u5b57\u7b26&#xff0c;\u7b97\u51fa\u8fd9\u4e2a\u5305\u6709\u591a\u957f<br \/>\n        int length &#061; stoi(buffer.substr(0,4));<\/p>\n<p>        \/\/ 3\u3001\u6574\u4e2a\u5305\u7684\u5b9e\u9645\u603b\u957f\u5ea6<br \/>\n        int totalLen &#061; 4 &#043; length;<\/p>\n<p>        \/\/ 4\u3001\u53e3\u888b\u80fd\u4e0d\u80fd\u88c5\u4e00\u4e2a\u5b8c\u6574\u7684\u5305&#xff1f;<br \/>\n        if(buffer.length() &gt;&#061; totalLen){<br \/>\n            \/\/ \u591f\u4e86&#xff0c;\u5207\u51fa\u5b8c\u6574\u7684\u5305<br \/>\n            string packet &#061; buffer.substr(0,totalLen);<\/p>\n<p>            \/\/ \u53e3\u888b\u91cc\u5220\u6389\u5df2\u7ecf\u5904\u7406\u7684\u90e8\u5206<br \/>\n            buffer.erase(0, totalLen);<\/p>\n<p>            \/\/ \u89e3\u6790\u8fd9\u4e2a\u5305<\/p>\n<p>            cout &lt;&lt; &#034;\u89e3\u6790\u51fa\u4e00\u6761\u5b8c\u6574\u6d88\u606f&#xff1a;&#034; &lt;&lt; endl;<br \/>\n            unpack(packet);<br \/>\n        }else<br \/>\n        {<br \/>\n            \/\/ \u89e3\u51b3\u534a\u5305<br \/>\n            \/\/ \u4e0d\u591f,\u534a\u5305&#xff0c;\u7b49\u4e0b\u6b21\u6570\u636e\u6765<br \/>\n            cout &lt;&lt; &#034;\u6570\u636e\u4e0d\u5b8c\u6574&#xff0c;\u7b49\u5f85\u66f4\u591a\u6570\u636e&#034; &lt;&lt; endl;<br \/>\n            break;<br \/>\n        }<br \/>\n    }<br \/>\n}<\/p>\n<p>\/\/ \u6a21\u62df\u7f51\u7edc\u6570\u636e\u5230\u8fbe<br \/>\nvoid on(string data){<br \/>\n    cout &lt;&lt; &#034;\u6536\u5230\u6570\u636e&#xff1a;&#034; &lt;&lt; data &lt;&lt; endl;<br \/>\n    buffer &#043;&#061; data; \/\/ \u4e22\u8fdb\u53e3\u888b<br \/>\n    processBuffer(); \/\/\u5c1d\u8bd5\u5904\u7406<br \/>\n}<\/p>\n<p>int main()<br \/>\n{<br \/>\n    \/\/ \u7c98\u5305\u548c\u8d34\u5305<br \/>\n    string packet1 &#061; pack(1, &#034;1001&#034;, &#034;hello&#034;);<br \/>\n    string packet2 &#061; pack(1, &#034;1002&#034;, &#034;ok&#034;);<\/p>\n<p>    cout &lt;&lt; &#034;\u573a\u666f\u4e00&#xff1a;\u6b63\u5e38\u5904\u7406&#034; &lt;&lt; endl;<br \/>\n    on(packet1);<\/p>\n<p>    cout &lt;&lt; &#034;\u573a\u666f\u4e8c&#xff1a;\u7c98\u5305&#xff08;\u4e00\u8d77\u53d1&#xff09;&#034; &lt;&lt; endl;<br \/>\n    on(packet1 &#043; packet2);<\/p>\n<p>    cout &lt;&lt; endl &lt;&lt; &#034;\u573a\u666f\u4e8c&#xff1a;\u7c98\u5305&#xff08;\u4e00\u8d77\u53d1&#xff09;&#034; &lt;&lt; endl;<br \/>\n    on(packet1.substr(0,10));<br \/>\n    on(packet1.substr(10));<\/p>\n<p>    return 0;<br \/>\n} <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"960\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261003122501-6ac0f41d01f7f.png\" width=\"577\" \/><\/p>\n<p>\u603b\u7ed3&#xff1a;\u4e09\u53e5\u8bdd\u518d\u6b21\u6df1\u523b\u7406\u89e3LV\u534f\u8bae<\/p>\n<li>\n<p>\u6253\u5305&#xff1a;Length &#043; MType &#043; IDLength &#043; MID &#043; Body&#xff0c;\u7528 &#043; \u62fc\u8d77\u6765\u3002<\/p>\n<\/li>\n<li>\n<p>\u62c6\u5305&#xff1a;\u5148\u8bfb\u524d 4 \u4e2a\u5b57\u7b26\u62ff\u5230 Length&#xff0c;\u5c31\u77e5\u9053\u540e\u9762\u8fd8\u6709\u591a\u5c11\u5b57\u7b26\u3002<\/p>\n<\/li>\n<li>\n<p>\u5904\u7406\u7c98\u5305\/\u534a\u5305&#xff1a;\u6570\u636e\u5148\u4e22\u8fdb buffer&#xff0c;\u5faa\u73af\u68c0\u67e5 buffer \u591f\u4e0d\u591f\u4e00\u4e2a\u5b8c\u6574\u7684\u5305&#xff08;4 &#043; Length&#xff09;&#xff0c;\u591f\u4e86\u5c31\u5207\u51fa\u6765&#xff0c;\u4e0d\u591f\u5c31\u7b49<\/p>\n<\/li>\n<p>\u6838\u5fc3\u516c\u5f0f&#xff1a;<\/p>\n<p>\u5b8c\u6574\u5305\u957f\u5ea6 &#061; 4 &#043; Length<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u76ee\u5f55<br \/>\n\u4e3a\u4ec0\u4e48\u9700\u8981\u8fd9\u4e2a\u534f\u8bae&#xff1f;&#xff08;\u89e3\u51b3\u7c98\u5305&#xff09;<br \/>\n\u62c6\u89e3\u201c\u5feb\u9012\u9762\u5355\u201d &#xff08;\u534f\u8bae\u7ed3\u6784&#xff09;<br \/>\n1. Length&#xff08;\u603b\u957f\u5ea6&#xff09;\u2014\u2014 4\u5b57\u8282&#xff08;\u56fa\u5b9a&#xff09;<br \/>\n2. MType&#xff08;\u6d88\u606f\u7c7b\u578b&#xff09;\u2014\u2014 4\u5b57\u8282&#xff08;\u56fa\u5b9a&#xff09;<br \/>\n3. IDLength&#xff08;ID\u957f\u5ea6&#xff09;\u2014\u2014 4\u5b57\u8282&#xff08;\u56fa\u5b9a&#xff09;<br \/>\n4<\/p>\n","protected":false},"author":2,"featured_media":112483,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[55,43,78],"topic":[],"class_list":["post-112487","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-c","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>\u62d2\u7edd\u7c98\u5305\uff01\u57fa\u4e8e C++ \u624b\u628a\u624b\u5e26\u4f60\u5b9e\u73b0\u4e00\u4e2a\u81ea\u5b9a\u4e49 LV \u534f\u8bae - \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\/112487.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u62d2\u7edd\u7c98\u5305\uff01\u57fa\u4e8e C++ \u624b\u628a\u624b\u5e26\u4f60\u5b9e\u73b0\u4e00\u4e2a\u81ea\u5b9a\u4e49 LV \u534f\u8bae - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u76ee\u5f55 \u4e3a\u4ec0\u4e48\u9700\u8981\u8fd9\u4e2a\u534f\u8bae&#xff1f;&#xff08;\u89e3\u51b3\u7c98\u5305&#xff09; \u62c6\u89e3\u201c\u5feb\u9012\u9762\u5355\u201d &#xff08;\u534f\u8bae\u7ed3\u6784&#xff09; 1. Length&#xff08;\u603b\u957f\u5ea6&#xff09;\u2014\u2014 4\u5b57\u8282&#xff08;\u56fa\u5b9a&#xff09; 2. MType&#xff08;\u6d88\u606f\u7c7b\u578b&#xff09;\u2014\u2014 4\u5b57\u8282&#xff08;\u56fa\u5b9a&#xff09; 3. IDLength&#xff08;ID\u957f\u5ea6&#xff09;\u2014\u2014 4\u5b57\u8282&#xff08;\u56fa\u5b9a&#xff09; 4\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/112487.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-03T12:25:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261003122459-6ac0f41b5ce25.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=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/112487.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/112487.html\",\"name\":\"\u62d2\u7edd\u7c98\u5305\uff01\u57fa\u4e8e C++ \u624b\u628a\u624b\u5e26\u4f60\u5b9e\u73b0\u4e00\u4e2a\u81ea\u5b9a\u4e49 LV \u534f\u8bae - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-03T12:25:02+00:00\",\"dateModified\":\"2026-10-03T12:25:02+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/112487.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/112487.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/112487.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u62d2\u7edd\u7c98\u5305\uff01\u57fa\u4e8e C++ \u624b\u628a\u624b\u5e26\u4f60\u5b9e\u73b0\u4e00\u4e2a\u81ea\u5b9a\u4e49 LV \u534f\u8bae\"}]},{\"@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":"\u62d2\u7edd\u7c98\u5305\uff01\u57fa\u4e8e C++ \u624b\u628a\u624b\u5e26\u4f60\u5b9e\u73b0\u4e00\u4e2a\u81ea\u5b9a\u4e49 LV \u534f\u8bae - \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\/112487.html","og_locale":"zh_CN","og_type":"article","og_title":"\u62d2\u7edd\u7c98\u5305\uff01\u57fa\u4e8e C++ \u624b\u628a\u624b\u5e26\u4f60\u5b9e\u73b0\u4e00\u4e2a\u81ea\u5b9a\u4e49 LV \u534f\u8bae - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u76ee\u5f55 \u4e3a\u4ec0\u4e48\u9700\u8981\u8fd9\u4e2a\u534f\u8bae&#xff1f;&#xff08;\u89e3\u51b3\u7c98\u5305&#xff09; \u62c6\u89e3\u201c\u5feb\u9012\u9762\u5355\u201d &#xff08;\u534f\u8bae\u7ed3\u6784&#xff09; 1. Length&#xff08;\u603b\u957f\u5ea6&#xff09;\u2014\u2014 4\u5b57\u8282&#xff08;\u56fa\u5b9a&#xff09; 2. MType&#xff08;\u6d88\u606f\u7c7b\u578b&#xff09;\u2014\u2014 4\u5b57\u8282&#xff08;\u56fa\u5b9a&#xff09; 3. IDLength&#xff08;ID\u957f\u5ea6&#xff09;\u2014\u2014 4\u5b57\u8282&#xff08;\u56fa\u5b9a&#xff09; 4","og_url":"https:\/\/www.wsisp.com\/helps\/112487.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-03T12:25:02+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261003122459-6ac0f41b5ce25.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/112487.html","url":"https:\/\/www.wsisp.com\/helps\/112487.html","name":"\u62d2\u7edd\u7c98\u5305\uff01\u57fa\u4e8e C++ \u624b\u628a\u624b\u5e26\u4f60\u5b9e\u73b0\u4e00\u4e2a\u81ea\u5b9a\u4e49 LV \u534f\u8bae - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-03T12:25:02+00:00","dateModified":"2026-10-03T12:25:02+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/112487.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/112487.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/112487.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u62d2\u7edd\u7c98\u5305\uff01\u57fa\u4e8e C++ \u624b\u628a\u624b\u5e26\u4f60\u5b9e\u73b0\u4e00\u4e2a\u81ea\u5b9a\u4e49 LV \u534f\u8bae"}]},{"@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\/112487","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=112487"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/112487\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/112483"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=112487"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=112487"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=112487"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=112487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}