Skip to content

Commit

Permalink
12.2 IO复用服务端 有bug
Browse files Browse the repository at this point in the history
  • Loading branch information
NaZixia committed Feb 29, 2024
1 parent 9b1e8bc commit eb620ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Binary file modified 12IO复用/2IO复用客户端/echo_mpserver
Binary file not shown.
6 changes: 2 additions & 4 deletions 12IO复用/2IO复用客户端/echo_mpserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,9 @@ int main(int argc,char *argv[])

if((fd_num=select(fd_max+1,&cpy_reads,0,0,&timeout))==-1)
break;
printf("5s...\n");
return 1;
if(fd_num==0)
continue;

fd_num=0;
for(i=0;i<fd_max+1;i++){
if(FD_ISSET(i,&cpy_reads))
{
Expand All @@ -72,7 +70,7 @@ int main(int argc,char *argv[])
if(fd_max<clnt_sock)
fd_max=clnt_sock;
int dd=clnt_sock;
//printf("connect %d client\n",dd);
printf("connect %d client\n",dd);
}
else
{
Expand Down

0 comments on commit eb620ec

Please sign in to comment.