mirabelle.transport.tcp

build-initializer

(build-initializer stream-handler tcp-timer shared-event-executor channel-group ssl-context)

A channel pipeline initializer for a TCP server.

epoll-netty-implementation

(epoll-netty-implementation)

gen-tcp-handler

(gen-tcp-handler stream-handler registry channel-group handler)

Wraps Netty boilerplate for common TCP server handlers. Given a reference to a core, a stats package, a channel group, and a handler fn, returns a ChannelInboundHandlerAdapter which calls (handler core stats channel-handler-context message) for each received message.

Automatically handles channel closure, and handles exceptions thrown by the handler by logging an error and closing the channel.

get-netty-implementation

(get-netty-implementation native?)

int32-frame-decoder

(int32-frame-decoder)

int32-frame-encoder

(int32-frame-encoder)

kqueue-netty-implementation

(kqueue-netty-implementation)

nio-netty-implementation

(nio-netty-implementation)

ssl-handler

(ssl-handler context)

Given an SSLContext, creates a new SSLEngine and a corresponding Netty SslHandler wrapping it.

tcp-handler

(tcp-handler stream-handler tcp-timer ctx message)

Given a core, a channel, and a message, applies the message to core and writes a response back on this channel.