1.2.0 permalink Arrow_down_16x16

make-server-socket

swank.util.net.sockets

  • (make-server-socket)
  • (make-server-socket options)
Create a java.net.ServerSocket. A map of `options':

:port - The port which this ServerSocket will listen on. It must
be a number between 0-65535. If 0 or not provided, the server
will be created on any free port.

:host - The address the server will bind to, can be used on multi
homed hosts. This can be an InetAddress or a hostname string. If
not provided or nil, it will listen on all addresses.

:backlog - The maximum queue length of incoming connection
indications (ie. connection requests). If the queue is full, new
indications will be refused. If set to less than or equal to 0,
the default value will be used.

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:6 top

(defn make-server-socket
  "Create a java.net.ServerSocket. A map of `options':

    :port - The port which this ServerSocket will listen on. It must
       be a number between 0-65535. If 0 or not provided, the server
       will be created on any free port.

    :host - The address the server will bind to, can be used on multi
      homed hosts. This can be an InetAddress or a hostname string. If
      not provided or nil, it will listen on all addresses.

    :backlog - The maximum queue length of incoming connection
      indications (ie. connection requests). If the queue is full, new
      indications will be refused. If set to less than or equal to 0,
      the default value will be used."
  ([] (ServerSocket.))
  ([options] (ServerSocket. (options :port 0)
                            (options :backlog 0)
                            (when-let [host (options :host)]
                              (if (instance? InetAddress host)
                                host
                                (InetAddress/getByName host))))))
Vars in swank.util.net.sockets/make-server-socket: defn instance? when-let
Used in 0 other vars

Comments top

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