vertx.net documentation

Provides a broad set of functions for creating TCP servers and
clients.

client

(client)(client properties)
Creates a TCP or SSL client (NetClient) instance using vertx.core/*vertx*.
properties is a map of properties to set on the newly created
client instance. They are translated into .setXXX calls by
camel-casing the keyword key. Example: {:key-store-path
"/some/path"} will trigger a call to .setKeyStorePath on the
client object. See the docuementation for
org.vertx.java.core.net.NetClient for a full list of properties.
Multiple connections to different servers can be made using the
same client instance.

close

(close server)(close server handler)
Close the server. Any open connections will be closed.

connect

(connect port handler)(connect port host handler)(connect client port host handler)
Attempts to open a connection to a server.
If host is not provided, it defaults to "localhost". If no client
is provided, one is created by calling the vertx.net/client fn.
handler can either be a two-arity fn that will be passed the
exception (if any) and socket from the result of the connect call,
or a Handler instance that will be called with the AsyncResult
object that wraps the exception and socket. Returns the client
instance.

listen

(listen server port)(listen server port host)(listen server port host handler)
Tells the server to start listening for connections on port.
If host is not provided, it defaults to "0.0.0.0". handler can
either be a two-arity fn that will be passed the exception (if any)
and server from the result of the listen call, or a Handler
instance that will be called with the AsyncResult object that wraps
the exception and server. Returns the server instance.

Be aware this is an async operation and the server may not bound on
return of the function.

on-close

(on-close socket handler)
Attaches a handler to the socket that will be called when the socket is closed.
handler can either be a zero-arity fn or a Handler instance.
Returns the socket.

on-connect

(on-connect server handler)
Attaches a connect handler to the server.
As the server accepts TCP or SSL connections it creates an instance
of NetSocket and passes it to the connect handler.  handler can
either be a single-arity fn or a Handler instance that will be
passed the socket. Returns the server instance.

The server can only have at most one connect handler at any one
time. 

send-file

(send-file sock filename)
Stream a file directly from disk to the outgoing connection.
This bypasses userspace altogether where supported by the
underlying operating system. This is a very efficient way to serve
files. Returns the socket.

server

(server)(server properties)
Creates a TCP or SSL server (NetServer) instance using vertx.core/*vertx*.
properties is a map of properties to set on the newly created
server instance. They are translated into .setXXX calls by
camel-casing the keyword key. Example: {:key-store-path
"/some/path"} will trigger a call to .setKeyStorePath on the
server object. See the docuementation for
org.vertx.java.core.net.NetServer for a full list of properties.