void record(int(*open_fn)(char *), char *url, char *outfile, int duration)
{
struct timeval start, curr;
int bytes, recvd, written, count = 0;
void record(int(*open_fn)(char *), char *url, char *outfile, int duration)
{
struct timeval start, curr;
int bytes, recvd, written, count = 0;
- if ((recvd = recv(in, buffer, CHUNKSIZE, 0)) < 1) {
- /* TODO: Insert better connection-loss recovery here */
+ if (error_sleep) {
+ sleep(error_sleep);
+ printf("Reconnecting... ");