well, first off, thanks for the replys. But I still haven't quite got the solution i'm looking for working. From your replys i'm assuming my best bet is to use threads for each connection (so I can continue to check the rest without waiting for timeouts)
or use net-select. But I can't seem to get net-select to work the way it says in the manual.
This is my little script updated from the last version, trying to implement the net-select function.
Code: Select all
(define (check-list file)
(set 'in-file (open file "read"))
(while
(read-line in-file)
(check-state (current-line))
)
(close in-file)
)
(define (check-state server)
(if (= (net-lookup server) nil)
(println (current-line) " does not resolve.")
(begin
(set 'sock (net-connect server 8080))
(if (= (net-select sock "write" 1000) nil)
(begin
(println (current-line) " is not connectable on port 8080.")
(net-close sock))
(begin
(println (current-line) " connection made.")
(net-close sock))
)
)
)
)
(if (= (main-args 2) nil)
(begin
(println "Please supply a proxy list as a argument.")
(exit)
)
)
(check-list (main-args 2))
(exit)
from reading the manaul net-select looks like it should return either true or nil after the 1000 mili-seconds. Am I mistaken or am I using net-select the wrong way?