You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The bug occurs when the client connects instantly after listen(), getSn_SR(sn) never returns SOCK_LISTEN, but returns SOCK_ESTABLISHED. In this case listen() calls close(sn) and returns SOCKERR_SOCKCLOSED.
Possible fix:
socket.c, int8_t listen(uint8_t sn)
changing code
The situation you describe, where there might be a delay between calling listen() and checking the socket status using getSn_SR before a TCP connection is established, seems plausible. Although it may not be a common occurrence, we will discuss it internally before deciding to implement it.
Listen() Function
Serial output
irinakim12
added a commit
to irinakim12/ioLibrary_Driver
that referenced
this issue
Nov 20, 2023
If reading Sn_SR in the Listen() function reveals that the socket is already in a connected state, issues may arise.
- Resolved by adding a check for SOCK_ESTABLISHED within the section of the Listen() function where Sn_SR is examined.
The bug occurs when the client connects instantly after listen(), getSn_SR(sn) never returns SOCK_LISTEN, but returns SOCK_ESTABLISHED. In this case listen() calls close(sn) and returns SOCKERR_SOCKCLOSED.
Possible fix:
socket.c, int8_t listen(uint8_t sn)
changing code
while(getSn_SR(sn) != SOCK_LISTEN)
{
close(sn);
return SOCKERR_SOCKCLOSED;
}
to
==============================
uint8_t res;
.....
res=getSn_SR(sn);
if (res != SOCK_LISTEN && res!=SOCK_ESTABLISHED)
{
close(sn);
return SOCKERR_SOCKCLOSED;
}
The text was updated successfully, but these errors were encountered: