Socket REPL breaks

Description

CMD or powershell:

c:\ClojureClr>clojure.main -e "(clojure.core.server/start-server {:name "test" :accept clojure.core.server/repl ort 4004}) (System.Threading.Thread/Sleep 50000) "
clojure.main -e "(clojure.core.server/start-server {:name "test" :accept clojure.core.server/repl ort 4004}) (System.Threading.Thread/Sleep 50000) "
#object[TcpListener 0xf7e717 "System.Net.Sockets.TcpListener"]

  1.  

    1.  

      1.  

        1. Socket server is running, lets try and connect in another shell:
          telnet localhost 4004

  1.  

    1.  

      1.  

        1. in the initial shell

Unhandled Exception: System.InvalidCastException: Unable to cast object of type 'clojure/core/server$repl__23465' to type 'clojure.lang.Named'.
at clojure/core/server$accept_connection__23342.invokeStatic(Object , Object , Object , Object , Object , Object , Object , Object )
at clojure/core/server$start_serverfn_23358fn23363fn23368_23372.invoke()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

  1.  

    1.  

      1.  

        1. process dies..

Environment

OS:Windows 10
x64

Activity

Show:
David Miller
April 1, 2018, 11:43 PM

Quoting the :accept function name is required.
The doc explicitly states that the value for :accept must be a namespaced symbol.
Without the quote, you are passing the value of clojure.cor.server/repl, an IFn.

import
March 19, 2017, 8:12 PM

Comment made by: mdrobulis

forgot to quote the :accept function

(clojure.core.server/start-server {:name "test" :accept clojure.core.server/repl ort 4004})
breaks on connection

(clojure.core.server/start-server {:name "test" :accept 'clojure.core.server/repl ort 4004})
works just fine.

Declined

Assignee

David Miller

Reporter

import