char GetTimeOutSimvol(unsigned int sec){ for(;;){ fd_set fdsr; FD_ZERO(&fdsr); FD_SET(STDIN_FILENO,&fdsr); timeval tt; tt.tv_sec=sec; tt.tv_usec=0; int count_desc; if ((count_desc=select(sock+1, &fdsr, NULL, NULL , &tt)) < 0){ if (errno == EINTR)continue; fprintf(stderr,"Select error! %d (%s)\n",errno, strerror(errno)); continue; } if(count_desc<0){ printf("Time Out has expired!\n"); return -1; } char Simvol; read(STDIN_FILENO,&Simvol,1); return Simvol; }}
if ((count_desc=select(sock+1, &fdsr, NULL, NULL , &tt)) < 0){
if ((count_desc=select(STDIN_FILENO+1, &fdsr, NULL, NULL , &tt)) < 0){
if(count_desc<0){
if(count_desc==0){