
17 Mar
2011
17 Mar
'11
8:02 a.m.
Here's what I would consider one idiomatic way to try all addresses on using SB-BSD-SOCKETS. (defun connect-to-host (socket host port) (let ((addresses (host-ent-addresses (get-host-by-name host)))) (tagbody :connect (let ((addr (pop addresses))) (handler-bind ((socket-error (lambda (e) (when addresses (go :connect))))) (socket-connect socket addr port)))))) Cheers, -- Nikodemus