Commit 84151182 authored by Gail Zacharias's avatar Gail Zacharias

add server-port function and use it

parent 3ecc4eba
......@@ -37,8 +37,8 @@
;; any new requests while all this is happening...
;;
(glisp:w-o-interrupts
(let ((port (slot-value (wserver-socket *wserver*) 'socket::local-port)))
(when (>= port 1000)
(let ((port (server-port)))
(when (and port (>= port 1000))
(net.aserve:shutdown) (net.aserve:start :port port :listeners listeners)))
(mapc #'funcall (ensure-list extra-functions))
......
......@@ -169,7 +169,7 @@ the browser in development mode). Defaults to NIL (the empty list)."
;;
(full-url (when *wserver*
(format nil "http://localhost:~a~a"
(socket:local-port (net.aserve:wserver-socket net.aserve:*wserver*))
(server-port)
(the url))))
("String. The web address in the current session which points at this page. Published on demand."
......
......@@ -166,7 +166,7 @@ the browser in development mode). Defaults to NIL (the empty list)."
;;
(full-url (when *wserver*
(format nil "http://localhost:~a~a"
(socket:local-port (net.aserve:wserver-socket net.aserve:*wserver*))
(server-socket)
(the url))))
("String. The web address in the current session which points at this page. Published on demand."
......
......@@ -32,7 +32,7 @@
(setq *log-file* (format nil "/home/dcooper8/kitchen/logs-~a-~a.lisp"
(gwl::iso-time (get-universal-time))
(slot-value (slot-value server 'net.aserve::socket) 'socket::local-port)))
(server-port server)))
(glisp:process-run-function
"log-maker"
#'(lambda()
......
......@@ -291,9 +291,7 @@
:type (format nil "~s" (the-object item type))
:root-path (the-object item root-path)
:host (or *request-server-ipaddr* :unknown)
:port (glisp:local-port
(slot-value (symbol-value (read-from-string "net.aserve:*wserver*"))
(read-from-string "net.aserve::socket")))))
:port (server-port)))
(defmethod print-object ((object remote-object) stream)
......
......@@ -31,7 +31,13 @@ A warning is given if an error condition occurs with <b>body</b>.
`(,(glisp:with-timeout-sym) (,timeout ,timeout-body) ,code)
code)))))))
(defun server-port (&optional (wserver net.aserve:*wserver*))
(when wserver
(let ((socket (net.aserve:wserver-socket wserver)))
(when socket
(glisp:local-port socket)))))
(defun announce-server-port ()
(let ((port (glisp:local-port (slot-value net.aserve:*wserver* 'net.aserve::socket))))
(let ((port (server-port)))
(when port
(format t "~&~%***** ~%Your Webserver is running on Port ~a.~%*****~%" port))))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment