Timeout in (get-url)

For the Compleat Fan
Locked
pjot
Posts: 733
Joined: Thu Feb 26, 2004 10:19 pm
Location: The Hague, The Netherlands
Contact:

Timeout in (get-url)

Post by pjot »

Hi,

According to the manual:
(get-url "http://www.nuevatec.com" 3000)

The optional argument int-timeout can specify a value in milliseconds. If no data is available from the host after the specified timeout, get-url returns the string ERR: timeout. When other error conditions occur, get-url returns a string starting with ERR: and the description of the error.
Now if I run the following using a random IP address:

Code: Select all

(get-url "http://11.12.13.16" 50)
...we are waiting forever for an answer. It seems that the timeout does not really expire...? Also for other URL's this seems to be a problem. Am I doing something wrong?

Peter

pjot
Posts: 733
Joined: Thu Feb 26, 2004 10:19 pm
Location: The Hague, The Netherlands
Contact:

Post by pjot »

Never mind, the waiting is for the DNS server to translate the IP address to a domain...

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Yes, that is what happens: newLISP starts checking for timeout not until after it has send out the request. So even if the timeout is set very short it will get out the request in any case. After it did this the timeout may have expired already.

Locked