Timeout in (get-url)

Started by pjot, June 14, 2008, 06:04:34 AM

Previous topic - Next topic

pjot

Hi,



According to the manual:
Quote
(get-url "http://www.nuevatec.com">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:

(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

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

Lutz

#2
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.