+ FD_ZERO(&rfds);
+ FD_SET(in, &rfds);
+
+ tv.tv_sec = 1;
+ tv.tv_usec = 0;
+
+ if ((retval = select(in + 1, &rfds, NULL, NULL, &tv)) == -1) {
+ error_sleep = 1;
+ continue;
+ }
+
+ if (!retval) {
+ gettimeofday(&curr, NULL);
+ continue;
+ }
+
+ if ((recvd = recv(in, buffer, CHUNKSIZE, 0)) < 1) {
+ error_sleep = 1;
+ continue;
+ }