老代码:
INT32 conn_fd = accept( listen_fd, (sockaddr *)&clientaddr, &clilen );//accept4( event_fd, (sockaddr *)&clientaddr, &clilen, SOCK_NONBLOCK ) if( conn_fd < 0 ) { MS_LOGER_FATAL("%s%s%s%s", LOG_CMD_FLAG , LOG_VOD_FLAG , "accept error" , strerror( errno )); } else { MS_LOGER_DEBUG("%s%s%s%d", LOG_CMD_FLAG , LOG_VOD_FLAG , "conn fd" , conn_fd); }
while (1) { INT32 conn_fd = accept( listen_fd, (sockaddr *)&clientaddr, &clilen );//accept4( event_fd, (sockaddr *)&clientaddr, &clilen, SOCK_NONBLOCK ) if( conn_fd < 0 ) { break; } else { MS_LOGER_DEBUG("%s%s%s%d", LOG_CMD_FLAG , LOG_VOD_FLAG , "conn fd" , conn_fd); } }