TCP connect failed

We are trying to add the ability to establish a TCP connection from the development board to a remote TCP server via OTBR to Nordic's matter routine and 52840 development board.

Refer to github.com/.../README_TCP.md, we have set up the network environment, and mentioned in the document, using the shell command on the terminal of success, And we set up a tcp connection with our own tcp server, the effect is similar:

> tcp connect 172.17.0.1 1234
Connecting to synthesized IPv6 address: fdde:ad00:beef:2:0:0:ac11:1
Done

Next, we created our own thread, and called the API provided by OpenThread for network programming instead of shell in the thread, trying to establish a tcp connection, but encountered the connect API returned -1, and there was no more information error.

We captured the connection message passed by the Raspberry PI, and successfully established a TCP connection under shell conditions.

What we now want to know is: on a Matter over Thread device, if you want to write some code to establish a connection with the tcp server and send and receive some tcp content, as the shell command does, whether there is a more direct reference document or code than analyzing the shell source code.

Or: Do you have suggestions on what to check when a connection is Reset by a client (the terminal itself) to abandon the connection? Neither Zephyr nor OpenThread's existing error messages can help us understand why the connection is being abandoned by the terminal?

Look forward to your comments, thank you!

Related