Skip to content
Open

#127 #141

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Ethernet/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,15 @@ int8_t close(uint8_t sn)

int8_t listen(uint8_t sn)
{
uint8_t getSR = 0;
CHECK_SOCKNUM();
CHECK_SOCKMODE(Sn_MR_TCP);
CHECK_SOCKINIT();
setSn_CR(sn,Sn_CR_LISTEN);
while(getSn_CR(sn));
while(getSn_SR(sn) != SOCK_LISTEN)
{
getSR = getSn_SR(sn);
while(getSR != SOCK_LISTEN && getSR != SOCK_ESTABLISHED)
{
close(sn);
return SOCKERR_SOCKCLOSED;
}
Expand Down