From: Juan Jose Garcia Ripoll Date: Sat, 13 Feb 2010 14:35:42 +0000 (+0100) Subject: When using threads and sockets, the stream is a two-way streams and its components... X-Git-Tag: ECL.10.2.1 X-Git-Url: http://git.pulsar-zone.net/?a=commitdiff_plain;h=113dd3c2ef0c00ae1408fa43c6823ed22cf5fef2;p=ecl.git When using threads and sockets, the stream is a two-way streams and its components must be closed separately. --- diff --git a/contrib/sockets/sockets.lisp b/contrib/sockets/sockets.lisp index b9906e3..88d08df 100755 --- a/contrib/sockets/sockets.lisp +++ b/contrib/sockets/sockets.lisp @@ -422,7 +422,13 @@ SB-SYS:MAKE-FD-STREAM.")) (let ((fd (socket-file-descriptor socket))) (unless (eql fd -1) ; already closed (cond ((slot-boundp socket 'stream) - (close (slot-value socket 'stream)) ;; closes fd indirectly + (let ((stream (slot-value socket 'stream))) + #+threads + (close (two-way-stream-input stream)) + #+threads + (close (two-way-stream-output stream)) + #-threads + (close stream)) ;; closes fd indirectly (slot-makunbound socket 'stream)) ((= (socket-close-low-level socket) -1) (socket-error "close")))