본문 바로가기
Development/WIZnet

IO Library Issue #127

by 루카오리 2023. 11. 21.

"IO Library Issue #127: Socket Closure Bug in listen() Function"

One of the prominent issues among various concerns is identified within the listen() function in the socket.c file.

The issue arises when reading getSn_SR(sn); if a TCP connection is already established, it leads to a socket closure state.

 

Upon testing, under normal circumstances, this issue does not manifest.

However, introducing a delay of approximately 1 second before line 254 triggers the problem. In this scenario, getSn_SR(sn) outputs SOCK_ESTABLISHED instead of SOCK_LISTEN, resulting in a socket closure.

When observing the serial output, errors become evident as described below.

I have made the following changes and have already submitted a Pull Request with the alterations.

Here is the Python code utilized for testing:

tcp_client.py
0.00MB

Feel free to provide any additional context or details, and I'll be happy to assist further.

IoLibrary issue:  https://github.com/Wiznet/ioLibrary_Driver/issues/127