* 8sync/systems/irc.scm (irc-socket-setup): Only connect to a valid
socket. Retry if connecting fails.
(let* ((s (socket PF_INET SOCK_STREAM 0))
(flags (fcntl s F_GETFL))
(ip-address (inet-ntop AF_INET (car (hostent:addr-list (gethost hostname))))))
- (fcntl s F_SETFL (logior O_NONBLOCK flags))
- (connect s AF_INET
- (inet-pton AF_INET ip-address)
- inet-port)
- s))
+ (cond (s
+ (fcntl s F_SETFL (logior O_NONBLOCK flags))
+ (connect s AF_INET (inet-pton AF_INET ip-address) inet-port)
+ s)
+ (else
+ (8sleep 1)
+ (irc-socket-setup hostname inet-port)))))
(define irc-eol "\r\n")