server

fun server(port: Int = -1, tlsContext: TlsContext = PLAINTEXT_CONTEXT, inProcessServerName: String = "", block: ServerBuilder<*>.() -> Unit): Server

Builds a gRPC Server using either a Netty transport or an in-process transport.

When inProcessServerName is non-empty, an in-process server is created (ignoring port/TLS). Otherwise a Netty server is created listening on the given port.

Return

the built Server

Parameters

port

the port to listen on (Netty transport only)

tlsContext

the TLS configuration for the server; defaults to PLAINTEXT_CONTEXT

inProcessServerName

if non-empty, creates an in-process server with this name

block

a configuration block applied to the server builder before building