diff --git a/package.lisp b/package.lisp index 73b1988..f33b48a 100644 --- a/package.lisp +++ b/package.lisp @@ -84,5 +84,9 @@ #:insufficient-implementation ; conditions regarding usocket support level #:unsupported - #:unimplemented)) + #:unimplemented + + #:socket-server + #:*remote-host* + #:*remote-port*)) ) ; unless diff --git a/server.lisp b/server.lisp index fe764ce..93b1bf4 100644 --- a/server.lisp +++ b/server.lisp @@ -1,12 +1,5 @@ (in-package :usocket) -(eval-when (:compile-toplevel :load-toplevel :execute) - (use-package :portable-threads) - - (export '(socket-server - *remote-host* - *remote-port*))) - (defun socket-server (host port function &optional arguments &key in-new-thread (protocol :stream) ;; for udp @@ -36,7 +29,7 @@ :timeout timeout :max-buffer-size max-buffer-size))))) (if in-new-thread - (values (spawn-thread (or name "USOCKET Server") #'real-call) socket) + (values (portable-threads:spawn-thread (or name "USOCKET Server") #'real-call) socket) (real-call))))) (defvar *remote-host*) @@ -102,7 +95,7 @@ `(,socket ,@(when element-type `(:element-type ,element-type))))) (client-stream (socket-stream client-socket))) (if multi-threading - (apply #'spawn-thread "USOCKET Client" real-function client-socket arguments) + (apply #'portable-threads:spawn-thread "USOCKET Client" real-function client-socket arguments) (prog1 (apply real-function client-socket arguments) (close client-stream) (socket-close client-socket))) diff --git a/usocket.asd b/usocket.asd index 0470e08..0e201cd 100644 --- a/usocket.asd +++ b/usocket.asd @@ -18,8 +18,8 @@ :licence "MIT" :description "Universal socket library for Common Lisp" :depends-on (:split-sequence - #+(and (or sbcl ecl) (not usocket-iolib)) :sb-bsd-sockets - #+usocket-iolib :iolib) + #+(and (or sbcl ecl) (not usocket-iolib)) :sb-bsd-sockets + #+usocket-iolib :iolib) :components ((:file "package") (:module "vendor" :depends-on ("package") :components (#+mcl (:file "kqueue") @@ -42,13 +42,13 @@ #+mcl (:file "mcl") #+mocl (:file "mocl") #+scl (:file "scl") - #+usocket-iolib (:file "iolib"))) - #-usocket-iolib - (:file "option" :depends-on ("backend")) - #+usocket-iolib + #+usocket-iolib (:file "iolib"))) + #-usocket-iolib + (:file "option" :depends-on ("backend")) + #+usocket-iolib (:module "backend" :depends-on ("condition") - :components ((:file "iolib" :depends-on ("iolib-sockopt")) - (:file "iolib-sockopt"))) + :components ((:file "iolib" :depends-on ("iolib-sockopt")) + (:file "iolib-sockopt"))) )) (defmethod perform ((op test-op) (c (eql (find-system :usocket))))