select(maxfd, &fset, NULL, NULL, NULL); /* wait for read ready */
if (FD_ISSET(fileno(filein), &fset)) { /* if ready on stdin */
if (fgets(sendbuff, MAXLINE, filein) == NULL) { /* if no input */
select(maxfd, &fset, NULL, NULL, NULL); /* wait for read ready */
if (FD_ISSET(fileno(filein), &fset)) { /* if ready on stdin */
if (fgets(sendbuff, MAXLINE, filein) == NULL) { /* if no input */