Skip to content

Commit

Permalink
Modified connect() function in socket.c
Browse files Browse the repository at this point in the history
added Function end conditions (SOCK_CLOSED)
  • Loading branch information
hkjung committed Feb 2, 2015
1 parent 1cf4272 commit 0ada86b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Ethernet/socket.c
Expand Up @@ -219,6 +219,11 @@ int8_t connect(uint8_t sn, uint8_t * addr, uint16_t port)
#endif
return SOCKERR_TIMEOUT;
}

if (getSn_SR(sn) == SOCK_CLOSED)
{
return SOCKERR_SOCKCLOSED;
}
}
#if _WIZCHIP_ == 5200 // for W5200 ARP errata
setSUBR((uint8_t*)"\x00\x00\x00\x00");
Expand Down

2 comments on commit 0ada86b

@etodanik
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the additional check for a disconnected socket as demonstrated here:
https://forum.wiznet.io/t/topic/1451/7?u=dannypovolotski

@etodanik
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix here is very important:
https://forum.wiznet.io/t/topic/1451/7?u=dannypovolotski

Please , can you guys merge it?

Please sign in to comment.