1.2.0 permalink Arrow_down_16x16

start-server-socket!

swank.util.net.sockets

  • (start-server-socket! server-socket handle-socket)
Given a `server-socket' (java.net.ServerSocket), call
`handle-socket' for each new connection and provide current
socket.

This will return immediately with the Thread that is blocking for
new connections. Use Thread.join() if you need to wait for the
server to close.

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/util/net/sockets.clj:29 top

(defn start-server-socket!
  "Given a `server-socket' (java.net.ServerSocket), call
   `handle-socket' for each new connection and provide current
   socket.

   This will return immediately with the Thread that is blocking for
   new connections. Use Thread.join() if you need to wait for the
   server to close."
  ([server-socket handle-socket]
     (dothread-keeping-clj nil
       (thread-set-name (str "Socket Server [" (thread-id) "]"))
       (with-open [#^ServerSocket server server-socket]
         (while (not (.isClosed server))
           (handle-socket (.accept server)))))))
Vars in swank.util.net.sockets/start-server-socket!: defn not str while with-open
Used in 0 other vars

Comments top

No comments for start-server-socket!. Log in to add a comment.