diff --git a/contrib/sockets/sockets.lisp b/contrib/sockets/sockets.lisp index e7c4f1ed4..b9906e3dd 100755 --- a/contrib/sockets/sockets.lisp +++ b/contrib/sockets/sockets.lisp @@ -1177,9 +1177,19 @@ also known as unix-domain sockets.")) (let ((stream (and (slot-boundp socket 'stream) (slot-value socket 'stream)))) (unless stream - (setf stream (let ((fd (socket-file-descriptor socket))) - (make-stream-from-fd fd #-:wsock :input-output #+:wsock :input-output-wsock - buffering))) + (setf stream + #+threads + (let* ((fd (socket-file-descriptor socket)) + (in (make-stream-from-fd fd #-wsock :input #+wsock :input-wsock + buffering)) + (out (make-stream-from-fd fd #-wsock :output #+wsock :output-wsock + buffering))) + (make-two-way-stream in out)) + #-threads + (let ((fd (socket-file-descriptor socket))) + (make-stream-from-fd fd #-:wsock :input-output + #+:wsock :input-output-wsock + buffering))) (setf (slot-value socket 'stream) stream) #+ ignore (sb-ext:cancel-finalization socket)) diff --git a/src/CHANGELOG b/src/CHANGELOG index c67e01ad9..057302ea5 100755 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -43,6 +43,10 @@ ECL 10.2.1: to recover from it. Now it jumps to the outermost protection frame (typically the toplevel). + - Socket streams are now two-way streams. This solves a problem with + multithreaded builds in certain platforms (OS X) where a C stream can not be + used to read and write simultaneously. + * Visible changes: - Significant speedup in access to hash tables of up to 30% by writing