net.ty.bootstrap

A clojure facade to build netty bootstraps. In netty, bootstraps are helpers to get channels.

->channel-option

(->channel-option k)

bind!

(bind! bs host port)

Bind bootstrap to a host and port

bootstrap

(bootstrap config)

Build a client bootstrap from a configuration map

channel-options

Valid options for bootstraps

connect!

(connect! bs)(connect! bs sa)(connect! bs x y)

Attempt connection of a bootstrap. Accepts as pre-configured bootstrap, and optionally a SocketAddressor Host and Port.

epoll-datagram-channel

epoll-event-loop-group

(epoll-event-loop-group nb-threads)(epoll-event-loop-group)

epoll-server-socket-channel

epoll-socket-channel

local-address!

(local-address! bs x)(local-address! bs x y)

Sets the bootstrap’s local address. Accepts either a SocketAddress or Host and Port.

nio-datagram-channel

nio-event-loop-group

(nio-event-loop-group nb-threads)(nio-event-loop-group)

Yield a new NioEventLoopGroup

nio-server-socket-channel

nio-socket-channel

remote-address!

(remote-address! bs sa)(remote-address! bs host port)

Set remote address for a client bootstrap, allows host and port to be provided as a SocketAddress

server-bootstrap

(server-bootstrap config)

Build a server bootstrap from a configuration map

set-child-handler!

(set-child-handler! bootstrap handler)

A server bootstrap has a child handler, this methods helps set it

set-group!

(set-group! bs group)

Set the group on top of which channels will be created and then handled.

shutdown-fn

(shutdown-fn chan config)

Closure to shutdown a channel and associated group

shutdown-gracefully!

(shutdown-gracefully! group)

Gracefully shut down a group

validate!

(validate! bs)

Validate that a bootstrap has correct parameters.

write-buffer-water-mark

(write-buffer-water-mark low high)