Appropriate error message if retrying connect failed.

This commit is contained in:
mainzelm 2002-01-23 15:06:08 +00:00
parent 676cbbb8a8
commit cad703672f
1 changed files with 11 additions and 9 deletions

View File

@ -239,17 +239,19 @@
(fdport-data:channel (fdport-data:channel
(fdport-data (socket:inport sock)))) (fdport-data (socket:inport sock))))
(if (eq? res 0) (if (eq? res 0)
(handle-EINPROGRESS sock) ;; If connect returned EINPROGRESS, we can check
;; it's success after the next success with getsockopt
(let ((val (socket-option sock
level/socket
socket/error)))
(if (not (zero? val))
(errno-error val
(errno-msg val)
%connect
sock
name)))
(loop)))))))))))) (loop))))))))))))
;;; If connect returned EINPROGRESS, we can check it's success after
;;; the next success with getsockopt
(define (handle-EINPROGRESS sock)
(let ((val (socket-option sock level/socket socket/error)))
(if (not (zero? val))
(errno-error val "scheme_connect" %connect))))
(import-os-error-syscall %connect (sockfd family name) "scheme_connect") (import-os-error-syscall %connect (sockfd family name) "scheme_connect")
;;;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- ;;;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-