• (create-repl-server port backlog bind-addr)
  • (create-repl-server port backlog)
  • (create-repl-server port)
create a repl on a socket

1 Example top

  • ;; Add a socket-based REPL to a web application.
    ;; First, generate a `ServletContextListener` implementation:
    (use '[clojure.contrib.server-socket :only [create-repl-server]])
        :name "org.project.ReplServer" 
        :implements [javax.servlet.ServletContextListener])
    (defn -contextInitialized [this e]
    	(.start (Thread. (partial create-repl-server 11111))))
    (defn -contextDestroyed [this e] )
    ;; Then, add this class to `web.xml`: org.project.ReplServer
    ;; Once the web application is deployed connect to the REPL socket with 
    ;; this command: `telnet yourserver 11111`
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/server_socket.clj:87 top

(defn create-repl-server 
  "create a repl on a socket"
  ([port backlog ^InetAddress bind-addr] 
     (create-server port socket-repl backlog bind-addr))
  ([port backlog] 
     (create-server port socket-repl backlog))
     (create-server port socket-repl)))
Vars in clojure.contrib.server-socket/create-repl-server: defn
Used in 0 other vars

Comments top

No comments for create-repl-server. Log in to add a comment.