Skip to content

Commit

Permalink
Update example_echosvr.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
wechatsunny authored Nov 21, 2018
1 parent 8ce6dfe commit 012bd1d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions example_echosvr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,12 @@ static void *readwrite_routine( void *arg )
{
ret = write( fd,buf,ret );
}
if( ret <= 0 )
if( ret > 0 || ( -1 == ret && EAGAIN == errno ) )
{
// accept_routine->SetNonBlock(fd) cause EAGAIN, we should continue
if (errno == EAGAIN)
continue;
close( fd );
break;
continue;
}
close( fd );
break;
}

}
Expand Down

0 comments on commit 012bd1d

Please sign in to comment.