Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a very unreliable connection which disconnects quite frequently and becomes a massive problem when downloading, as the option to resume is not always available.

The solution that comes to my mind is to prevent processes to know about the disconnection while I am reconnecting so that downloads do not fail.

How can I do this? (I am running Linux)

share|improve this question
add comment

2 Answers

I think you can not do that. Processes (applications) have their own connections. Usually if your connection (ie. PPP) goes down, these other connections are also interrupted. However, these connections being managed by each application in part, you may want to look for some 'timeout' options in those application's settings. It may help to increase the timeout.

share|improve this answer
add comment

Applications already do this. The only time your connections will be severed is if the TCP timeout expires, or your IP changes.
You can adjust the TCP timeout, but the method varies based on which OS youre using (linux/solaris/bsd/...).
If your IP changes, then youre out of luck. TCP uses the IP address to maintain the session, if that IP changes, the session is no longer valid and is terminated.

share|improve this answer
    
I am using Linux (Ubuntu 11.10), how to adjust TCP timeout in it? –  Ankit Jan 18 '12 at 5:23
    
You can do look at /proc/sys/net/ipv4/tcp_retries to see what its currently at, and echo a new value to that file to set it echo 15 > /proc/sys/net/ipv4/tcp_retries. However this will clear on reboot. I dont know ubuntu, but I'm assuming it has the /etc/sysctl.conf file where you can set this permanently. Note however that applications can set their own internal timeout. If they do, this wont help anything. –  Patrick Jan 18 '12 at 15:29
    
There are actually two files there with names - tcp_retries1 and tcp_retries2`. And it takes my approx. 3 minutes to reestablish connection, so how many retries would work? –  Ankit Jan 19 '12 at 5:29
    
Ooops, i meant to say tcp_retries2, sorry. tcp_retries1 is not what you want. And the value is hard to calculate, just try increasing it from what it already is and see if it helps. –  Patrick Jan 19 '12 at 13:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.