This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuote from: "Dmi"
btw, nil in newLisp is equivalent of "false", and
(if (= (net-lookup server) nil) ...
is equivalent to
(if (net-lookup server) ...
(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)
(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-connect server 8080) nil)
(println (current-line) " is NOT online")
(println (current-line) " is online")
)
)
(check-list "servers.txt")
(exit)