HowTo increase FTP-Open timeout (ehost error)

per <>
Mon Jul 16 23:10:34 CEST 2001

Sean Hinde <> wrote:
>> I'm using the FTP-Module to open 32 ftp conections with 32 
>> mobiles. Sometimes I see an "ehost" error when I try to open 
>> a connection. The problem is that it takes sometimes more 
>> than 60secs to open a connection. 
>> Does somebody know how to increase the timer for this ehost-error?
>The short answer is that it is not possible. It appears to be hard coded as 
>-define(OPEN_TIMEOUT,60*1000). in ftp.erl
>This is used directly in the gen_tcp:connect/4 call so it is not
>configurable at runtime.
>Your options are:
>* Change the -define and recompile
>* Modify ftp.erl to make it a configureable parameter..
>* Ask Ericsson to change it in the next patch release.

It may be the case that neither of those will help a whole lot though -
the TCP/IP stack in the kernel of most OSes will impose its own timeout
on TCP connection attempts, and changing the argument to
gen_tcp:connect() can't *raise* that timeout. A typical value on Unices
is ~ 75 seconds, which (like the 60 seconds of ftp.erl) is very
"generous" for "normal" situations, but not much higher than 60. I think
Nico will need to code for the possibility of connection timeouts and do
explicit retries.

--Per Hedeland

More information about the erlang-questions mailing list