newLISP Fan Club

Forum => Anything else we might add? => Topic started by: pjot on June 14, 2008, 06:04:34 AM

Title: Timeout in (get-url)
Post by: pjot on June 14, 2008, 06:04:34 AM
Hi,



According to the manual:
Quote
(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:

(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
Title:
Post by: pjot on June 14, 2008, 06:15:52 AM
Never mind, the waiting is for the DNS server to translate the IP address to a domain...
Title:
Post by: Lutz on June 14, 2008, 06:28:17 AM
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.