Timeout for get-url?
Timeout for get-url?
What is the default timeout for get-url if it doesn't recieve any data, and is there a way to specify a timeout?
Thanks.
Thanks.
In any case you would have to change kernel settings to control this timeout. The system waits in a socket library connect() call. I am not aware of a method to control a timeout of that function call from 'C'. This is different from already connected sockets where you can specify a timeout using select(). So rolling your 'own' get-url won't help you.
Lutz
Lutz
On BSD/LINUX you could do a:
to find out if a timeout settings is available, and then try to change the setting.
Lutz
Code: Select all
sysctl -a
Lutz
This is an annoying problem indeed, I suffer from this with my RSS reader as well. Hmm... maybe we can work around it as mentioned previously in another discussion:
The '-c 1' option pings only once.
-Peter
Code: Select all
(set 'result (exec "ping -c 1 www.newlisp.org "))
(if (> (length result) 0)
(get-url "www.newlisp.org")
(println "website not available"))
The '-c 1' option pings only once.
-Peter
Well, that cannot be solved within newLisp. So you need external tools for this.
Suppose a 'ping' delivers a result, then you must know if port 80 is alive (assuming the webserver is running on this port). The only way I see is using 'nmap' for that:
For example:
Even then the remote webserver may be malfunctioning, but there is nothing more you can do - at least, I don't know any other tricks here. :-(
-Peter
Suppose a 'ping' delivers a result, then you must know if port 80 is alive (assuming the webserver is running on this port). The only way I see is using 'nmap' for that:
Code: Select all
nmap -p 80 <remote-host>
The result can be parsed in newLisp, same as with the 'ping', so you can find out if the port is really alive.peter@Solarstriker:~/programming/newlisp$ nmap -p 80 www.newlisp.org
Starting nmap 3.50 ( http://www.insecure.org/nmap/ ) at 2005-08-13 01:19 CEST
Interesting ports on ds209-72.ipowerweb.com (66.235.209.72):
PORT STATE SERVICE
80/tcp open http
Nmap run completed -- 1 IP address (1 host up) scanned in 0.957 seconds
Even then the remote webserver may be malfunctioning, but there is nothing more you can do - at least, I don't know any other tricks here. :-(
-Peter
Our network guru Norman has created a portscanner with newLisp:
http://www.nodep.nl/downloads/newlisp/portscan.lsp
I am not sure how well it works, but you can give it a try.
-Peter
http://www.nodep.nl/downloads/newlisp/portscan.lsp
I am not sure how well it works, but you can give it a try.
-Peter