Fixes bug 179015: Feature request: socket-port's id/name includes

service-name/port
This commit is contained in:
Abdulaziz Ghuloum 2007-12-28 00:05:44 -05:00
parent 982d286029
commit 771b9699b5
2 changed files with 8 additions and 8 deletions

View File

@ -1927,33 +1927,33 @@
(fh->input-port (vector-ref r 3) (fh->input-port (vector-ref r 3)
cmd input-file-buffer-size #f #t))))) cmd input-file-buffer-size #f #t)))))
(define (socket->ports socket who host) (define (socket->ports socket who id)
(if (< socket 0) (if (< socket 0)
(io-error 'tcp-connect host socket) (io-error 'tcp-connect id socket)
(let ([close (let ([close
(let ([closed-once? #f]) (let ([closed-once? #f])
(lambda () (lambda ()
(if closed-once? (if closed-once?
((file-close-proc host socket)) ((file-close-proc id socket))
(set! closed-once? #t))))]) (set! closed-once? #t))))])
(values (values
(fh->output-port socket (fh->output-port socket
host output-file-buffer-size #f close) id output-file-buffer-size #f close)
(fh->input-port socket (fh->input-port socket
host input-file-buffer-size #f close))))) id input-file-buffer-size #f close)))))
(define (tcp-connect host srvc) (define (tcp-connect host srvc)
(socket->ports (socket->ports
(foreign-call "ikrt_tcp_connect" (foreign-call "ikrt_tcp_connect"
(string->utf8 host) (string->utf8 srvc)) (string->utf8 host) (string->utf8 srvc))
'tcp-connect 'tcp-connect
host)) (string-append host ":" srvc)))
(define (tcp-connect-nonblocking host srvc) (define (tcp-connect-nonblocking host srvc)
(socket->ports (socket->ports
(foreign-call "ikrt_tcp_connect_nonblocking" (foreign-call "ikrt_tcp_connect_nonblocking"
(string->utf8 host) (string->utf8 srvc)) (string->utf8 host) (string->utf8 srvc))
'tcp-connect-nonblocking 'tcp-connect-nonblocking
host)) (string-append host ":" srvc)))
) )

View File

@ -1 +1 @@
1294 1296