mirror of
https://github.com/espressif/openthread.git
synced 2026-07-05 20:00:23 +00:00
a055c4b9b8
This commit introduces a new platform abstraction layer for TCP connections and listeners, enabling OpenThread to leverage platform- provided TCP stacks. The API is designed for asynchronous, event-driven environments and can easily support POSIX as well as various embedded network stacks. In the core, `Ip6::PlatTcp` and its nested `Connection` and `Listener` classes are introduced to manage these platform interactions, providing a clean C++ interface for the OpenThread core. The `PlatTcp` manager is integrated into the `Instance` class and utilizes `Tasklet` for asynchronous resource cleanup. Additionally, this commit adds a comprehensive unit test to verify the TCP platform abstraction and `Ip6::PlatTcp` implementation. The tests cover listener and connection lifecycles, data flow, flow control, incoming connection acceptance, and active object iteration.