select (FD_SETSIZE, &read_fd_set, NULL, NULL, &tv); { while (!feof(stream_in)) { fscanf(stream_in, "%s", http_response); printf ("DATA: '%s'\n", http_response); fprintf (savefile, "%s", http_response); } printf("end stream\n"); read_fd_set = active_fd_set; } printf ("timeout\n");