(defn make-connection ;; rename to make-swank-connection
"Given a `socket', creates a swank connection. Accepts an optional
argument `encoding' to define the encoding of the connection. If
encoding is nil, then the default encoding will be used.
See also: `*default-encoding*', `start-server-socket!'"
([#^Socket socket] (make-connection socket *default-encoding*))
([#^Socket socket encoding]
(let [#^String
encoding (or (encoding-map encoding encoding) *default-encoding*)]
{:socket socket
:reader (InputStreamReader. (.getInputStream socket) encoding)
:writer (OutputStreamWriter. (.getOutputStream socket) encoding)
:writer-redir (ref nil)
:indent-cache (ref {})
:indent-cache-pkg (ref nil)
:control-thread (ref nil)
:read-thread (ref nil)
:repl-thread (ref nil)})))
Vars in
swank.core.connection/make-connection:
defn
let
Used in 0 other vars
Comments top
No comments for make-connection. Log in to add a comment.