ClojureCLR

Socket REPL breaks

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    OS:Windows 10
     x64

Description

CMD or powershell:

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

        1. Socket server is running, lets try and connect in another shell:
          telnet localhost 4004
        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. process dies..

Activity

Hide
Martynas Drobulis added a comment -

forgot to quote the :accept function

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

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

Show
Martynas Drobulis added a comment - forgot to quote the :accept function (clojure.core.server/start-server {:name "test" :accept clojure.core.server/repl :port 4004}) breaks on connection (clojure.core.server/start-server {:name "test" :accept 'clojure.core.server/repl :port 4004}) works just fine.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: