{"id":6057,"date":"2025-06-04T11:30:33","date_gmt":"2025-06-04T03:30:33","guid":{"rendered":"http:\/\/blog.coolcoding.cn\/?p=6057"},"modified":"2025-06-04T13:03:03","modified_gmt":"2025-06-04T05:03:03","slug":"%e5%9b%a2%e7%bb%931-4-4%e9%b8%bf%e8%92%995-0-%e5%b9%b3%e5%8f%b0%e5%85%bc%e5%ae%b9%e6%80%a7%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"https:\/\/blog.coolcoding.cn\/?p=6057","title":{"rendered":"\u56e2\u7ed31.4.4+\u9e3f\u84995.0 \u5e73\u53f0\u517c\u5bb9\u6027\u95ee\u9898"},"content":{"rendered":"\n<p>\u73b0\u8c61\u63cf\u8ff0\uff1a<\/p>\n\n\n\n<p>\u8fdb\u5165\u6e38\u620f\u540e\uff0c\u65ad\u5f00\u7f51\u7edc\u8fde\u63a5\uff0c\u6e38\u620f\u95ea\u9000<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>NETMANAGER_BASE: &#91;network_module.cpp 59] Subscribe is called\nNETMANAGER_BASE: &#91;network_exec.cpp 116] ExecSubscribe\nTuanjie: Could not allocate memory: System out of memory!\nTuanjie: Trying to allocate: 398659429081B with 16 alignment. MemoryLabel: String\nTuanjie: Allocation happened at: Line:525 in \nTuanjie: Memory overview\nTuanjie: &#91; ALLOC_TEMP_TLS ] used: 4507B | peak: 0B | reserved: 6455296B \nTuanjie: &#91; ALLOC_DEFAULT ] used: 76851824B | peak: 0B | reserved: 184561664B \nTuanjie: &#91; ALLOC_TEMP_JOB_1_FRAME ] used: 0B | peak: 0B | reserved: 0B \nTuanjie: &#91; ALLOC_TEMP_JOB_2_FRAMES ] used: 0B | peak: 0B | reserved: 0B \nTuanjie: &#91; ALLOC_TEMP_JOB_4_FRAMES (JobTemp) ] used: 71B | peak: 0B | reserved: 20971520B \nTuanjie: &#91; ALLOC_TEMP_JOB_ASYNC (Background) ] used: 442B | peak: 0B | reserved: 12582912B \nTuanjie: &#91; ALLOC_GFX ] used: 1903336B | peak: 0B | reserved: 33554432B \nTuanjie: &#91; ALLOC_CACHEOBJECTS ] used: 74064092B | peak: 0B | reserved: 85213184B \nTuanjie: &#91; ALLOC_TYPETREE ] used: 17014696B | peak: 0B | reserved: 20971520B \nMUSL-SIGCHAIN: signal_chain_handler call 2 rd sigchain action for signal: 5 sca_sigaction=5a32bbb810 noreturn=0 FREEZE_signo_5 thread_list_lock_status:-1 tl_lock_count=0 tl_lock_waiters=0 tl_lock_tid_fail=-1 tl_lock_count_tid=642 tl_lock_count_fail=-10000 tl_lock_count_tid_sub=642 thread_list_lock_after_lock=32291 thread_list_lock_pre_unlock=32291 thread_list_lock_pthread_exit=32295 thread_list_lock_tid_overlimit=-1 tl_lock_unlock_count=0 __pthread_gettid_np_tl_lock=0 __pthread_exit_tl_lock=0 __pthread_create_tl_lock=0 __pthread_key_delete_tl_lock=0 __synccall_tl_lock=0 __membarrier_tl_lock=0 install_new_tls_tl_lock=0 set_syscall_hooks_tl_lock=0 set_syscall_hooks_linux_tl_lock=0 fork_tl_lock=0 <\/code><\/pre>\n\n\n\n<p>\u8ffd\u67e5\u53d1\u73b0\u51fa\u5728\u7f51\u7edc\u63a5\u6536\u6570\u636e\u8fd9\u5757\u6709\u95ee\u9898<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>private void AsyncReadCallback(IAsyncResult ar)\r\n{\r\n    StateObject state = (StateObject)ar.AsyncState;\r\n    TcpClient tc = state.client;\r\n    if (!tc.Connected)\r\n    {\r\n        return;\r\n    }\r\n    NetworkStream ns = tc.GetStream();\r\n    int num = ns.EndRead(ar);\r\n    if (num > 0)\r\n    {\r\n        \/\/ ... process data\r\n        ns.BeginRead(buffer, 0, buffer.length, new AsyncCallback(AsyncReadCallback), state);\r\n    }\r\n}<\/code><\/pre>\n\n\n\n<p>\u5728Unity2021.3.X\u7684Android\u5e73\u53f0\u4e0a\uff0c\u82e5Wifi\u65ad\u5f00\u8fde\u63a5\uff0c\u5219 num \u8fd4\u56de &lt;=0\uff0c\u8fde\u63a5\u4e2d\u6b62<\/p>\n\n\n\n<p>\u4f46\u5728Tuanjie1.4.4\u7684\u9e3f\u8499\u5e73\u53f0\u4e0a\uff0c\u82e5Wifi\u65ad\u5f00\u5219\u4f1a\u4ea7\u751f\u5f02\u5e38\uff0c\u5982\u679c\u4e0d\u5904\u7406\u5f02\u5e38\uff0c\u4e2d\u53d1\u751f\u5185\u5b58\u6ea2\u51fa<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>private void AsyncReadCallback(IAsyncResult ar)\n{\n    StateObject state = (StateObject)ar.AsyncState;\n    TcpClient tc = state.client;\n    if (!tc.Connected)\n    {\n        return;\n    }\n    NetworkStream ns = tc.GetStream();\n    int num = 0;\n    try\n    {\n        num = ns.EndRead(ar);\n    }\n    catch\n    {\n    }\n    if (num > 0)\n    {\n        \/\/ ... process data\n        ns.BeginRead(buffer, 0, buffer.length, new AsyncCallback(AsyncReadCallback), state);\n    }\n}<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u73b0\u8c61\u63cf\u8ff0\uff1a \u8fdb\u5165\u6e38\u620f\u540e\uff0c\u65ad\u5f00\u7f51\u7edc\u8fde\u63a5\uff0c\u6e38\u620f\u95ea\u9000 \u8ffd\u67e5\u53d1\u73b0\u51fa\u5728\u7f51\u7edc\u63a5\u6536\u6570\u636e\u8fd9\u5757\u6709\u95ee\u9898 \u5728Unity2021.3. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/6057"}],"collection":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6057"}],"version-history":[{"count":5,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/6057\/revisions"}],"predecessor-version":[{"id":6062,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/6057\/revisions\/6062"}],"wp:attachment":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6057"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6057"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6057"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}