1.2.0 permalink Arrow_down_16x16

make-connection

swank.core.connection

  • (make-connection socket)
  • (make-connection socket encoding)
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!'

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source swank/core/connection.clj:30 top

(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.