Socket streams are now two-way streams.

This commit is contained in:
Juan Jose Garcia Ripoll 2010-02-12 18:33:04 +01:00
parent d500289efa
commit dd4d8e036f
2 changed files with 17 additions and 3 deletions

View file

@ -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))

View file

@ -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