Permalink
Browse files

Make the socket stream a flexi-stream after connect.

  • Loading branch information...
Markus Flambard
Markus Flambard committed Jul 17, 2011
1 parent c72b056 commit eccaecb7ece48115e164a1ec03e6dc648db59fe7
Showing with 7 additions and 2 deletions.
  1. +5 −2 src/listen.lisp
  2. +2 −0 src/remote-node.lisp
View
@@ -24,6 +24,9 @@
(defun accept-connect ()
(if *listening-socket*
- (usocket:socket-accept *listening-socket*
- :element-type '(unsigned-byte 8))
+ (let ((socket (usocket:socket-accept *listening-socket*
+ :element-type '(unsigned-byte 8))))
+ (setf (usocket:socket-stream socket)
+ (make-flexi-stream (usocket:socket-stream socket)))
+ socket)
(error 'not-listening-on-socket)))
View
@@ -41,6 +41,8 @@
(handler-bind ((condition #'(lambda (condition)
(declare (ignore condition))
(usocket:socket-close socket))))
+ (setf (usocket:socket-stream socket)
+ (make-flexi-stream (usocket:socket-stream socket)))
(multiple-value-bind (full-node-name flags version)
(perform-client-handshake (usocket:socket-stream socket) cookie)
(declare (ignore full-node-name flags version))

0 comments on commit eccaecb

Please sign in to comment.