=== ETCP API Test (etcp_send, etcp_bind) === Testing with 100 packets of random sizes (10-500 bytes) Total data to transfer: 24691 bytes (0.24 KB average per packet) Creating server... [CONFIG DEBUG] Opening config file: /tmp/utun_test_oVJWUS/server.conf [CONFIG DEBUG] Successfully opened config file [CONFIG DEBUG] Checking config - priv_key='67b705a92b41bcaae105af2d6a17743faa7b26ccebba8b3b9b0af05e9cd1d5fb' (len=64), pub_key='1c55e4ccae7c4470707759086738b10681bf88b81f198cc2ab54a647d1556e17c65e6b1833e0c771e5a39382c03067c388915a4c732191bc130480f20f8e00b9' (len=128), node_id=1229782938247303441 [CONFIG DEBUG] Validation results - need_priv_key=0, need_pub_key=0, need_node_id=0 [CONFIG DEBUG] Opening config file: /tmp/utun_test_oVJWUS/server.conf [CONFIG DEBUG] Successfully opened config file Server created, waiting for connection... Creating client... [CONFIG DEBUG] Opening config file: /tmp/utun_test_oVJWUS/client.conf [CONFIG DEBUG] Successfully opened config file [CONFIG DEBUG] Checking config - priv_key='4813d31d28b7e9829247f488c6be7672f2bdf61b2508333128e386d1759afed2' (len=64), pub_key='c594f33c91f3a2222795c2c110c527bf214ad1009197ce14556cb13df3c461b3c373bed8f205a8dd1fc0c364f90bf471d7c6f5db49564c33e4235d268569ac71' (len=128), node_id=2459565876494606882 [CONFIG DEBUG] Validation results - need_priv_key=0, need_pub_key=0, need_node_id=0 [CONFIG DEBUG] Opening config file: /tmp/utun_test_oVJWUS/client.conf [CONFIG DEBUG] Successfully opened config file Client created [03:30:18-447.936] [WARN] [1] (etcp_api.c:34) etcp_bind() etcp_bind: ID 0 already bound, overwriting [03:30:18-447.965] [WARN] [1] (etcp_api.c:34) etcp_bind() etcp_bind: ID 0 already bound, overwriting Callbacks registered for ID=0 (server=0x5a9293de2900, client=0x5a9293de2790) Sending 100 packets in each direction via etcp_send... Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connection check: client=1, server=1 Connections ready: client=0x5a92b76d1290, server=0x5a92b7716270 Starting forward transfer (client -> server) via etcp_send... Starting backward transfer (server -> client) via etcp_send... Backward transfer completed: 100/100 packets in 8.68 ms === SUCCESS: Bidirectional transfer via etcp_api completed! === Forward (client->server): 100/100 packets in -26337523.18 ms Backward (server->client): 100/100 packets in 8.68 ms Total time: 15.85 ms Cleaning up... 🔍 [UTUN_INSTANCE LEAK DIAGNOSIS] Phase: BEFORE_CLEANUP Instance: 0x5a92b76c8c90 Node ID: 1229782938247303441 UA instance: 0x5a92b76c8490 Running: 0 📊 STRUCTURE COUNTS: ETCP Sockets: 1 active ETCP Connections: 1 active ETCP Links: 2 total 🔧 RESOURCE STATUS: Memory Pool: ALLOCATED TUN Interface: NULL TUN FD: -1 Connections list: 0x5a92b7716270 ETCP Sockets list: 0x5a92b76ca330 ⚠️ POTENTIAL LEAKS: ❌ Memory Pool not freed ❌ 1 ETCP sockets still allocated ❌ 1 ETCP connections still allocated ❌ 2 ETCP links still allocated 📋 RECOMMENDATIONS: → Call memory_pool_destroy() before freeing instance → Iterate and call etcp_socket_remove() for each socket → Iterate and call etcp_connection_close() for each connection [03:30:18-622.347] [WARN] [1] (etcp_api.c:56) etcp_unbind() etcp_unbind: ID 0 not bound 🔍 [UTUN_INSTANCE LEAK DIAGNOSIS] Phase: BEFORE_CLEANUP Instance: 0x5a92b76cd420 Node ID: 2459565876494606882 UA instance: 0x5a92b76c8490 Running: 0 📊 STRUCTURE COUNTS: ETCP Sockets: 1 active ETCP Connections: 1 active ETCP Links: 2 total 🔧 RESOURCE STATUS: Memory Pool: ALLOCATED TUN Interface: NULL TUN FD: -1 Connections list: 0x5a92b76d1290 ETCP Sockets list: 0x5a92b76ce7d0 ⚠️ POTENTIAL LEAKS: ❌ Memory Pool not freed ❌ 1 ETCP sockets still allocated ❌ 1 ETCP connections still allocated ❌ 2 ETCP links still allocated 📋 RECOMMENDATIONS: → Call memory_pool_destroy() before freeing instance → Iterate and call etcp_socket_remove() for each socket → Iterate and call etcp_connection_close() for each connection [03:30:18-622.405] [WARN] [1] (etcp_api.c:56) etcp_unbind() etcp_unbind: ID 0 not bound 🔍 BEFORE_DESTROY: UASYNC Resource Report for 0x5a92b76c8490 Timer Statistics: allocated=281, freed=274, active=7 Socket Statistics: allocated=2, freed=2, active=0 Timer: node=0x5a92b7714f90, expires=1771115418707 ms, cancelled=0 Timer: node=0x5a92b7714f60, expires=1771115418710 ms, cancelled=0 Timer: node=0x5a92b77157d0, expires=1771115418714 ms, cancelled=0 Timer: node=0x5a92b7720ad0, expires=1771115418719 ms, cancelled=0 Timer: node=0x5a92b7722d10, expires=1771115418712 ms, cancelled=0 Timer: node=0x5a92b7714f30, expires=1771115418717 ms, cancelled=0 Active timers in heap: 6 Socket array capacity: 16, active: 0 Total active sockets: 0 🔚 BEFORE_DESTROY: End of resource report [03:30:18-622.414] [ERROR] [32] (u_async.c:1007) uasync_destroy() Memory leaks detected before cleanup: timers 281/274, sockets 2/2 [03:30:18-622.418] [ERROR] [1024] (u_async.c:1009) uasync_destroy() Timer leak: allocated=281, freed=274, diff=7 [03:30:18-622.421] [ERROR] [1024] (u_async.c:1012) uasync_destroy() Socket leak: allocated=2, freed=2, diff=0 === TEST PASSED === All 100 packets transmitted in each direction via etcp_api