mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-02-12 02:30:19 -08:00
When using threads and sockets, the stream is a two-way streams and its components must be closed separately.
This commit is contained in:
parent
b486b14e9e
commit
113dd3c2ef
1 changed files with 7 additions and 1 deletions
|
|
@ -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")))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue