Skip to content

Commit

Permalink
Merge pull request Tencent#26 from priest334/learn
Browse files Browse the repository at this point in the history
Update example_echosvr.cpp
  • Loading branch information
leiffyli authored May 31, 2017
2 parents d7c6dd8 + b369ae4 commit b4c4d69
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions example_echosvr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <fcntl.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <errno.h>

using namespace std;
struct task_t
Expand Down Expand Up @@ -86,6 +87,9 @@ static void *readwrite_routine( void *arg )
}
if( ret <= 0 )
{
// accept_routine->SetNonBlock(fd) cause EAGAIN, we should continue
if (errno == EAGAIN)
continue;
close( fd );
break;
}
Expand Down

0 comments on commit b4c4d69

Please sign in to comment.