vertx / io.vertx.ext.stomp / StompServer

# StompServer

`interface StompServer`

Defines a STOMP server. STOMP servers delegates to a StompServerHandler that let customize the behavior of the server. By default, it uses a handler compliant with the STOMP specification, but let you change anything.

Author
Clement Escoffier

### Functions

actualPort | `abstract fun actualPort(): Int` Gets the port on which the server is listening. This is useful if you bound the server specifying 0 as port number signifying an ephemeral port.
close | `abstract fun close(completionHandler: Handler<AsyncResult<Void>>): Unit` `abstract fun close(): Unit` Closes the server.
create | `open static fun create(vertx: Vertx, options: StompServerOptions): StompServer` `open static fun create(vertx: Vertx, netServer: NetServer): StompServer` `open static fun create(vertx: Vertx, net: NetServer, options: StompServerOptions): StompServer` Creates a StompServer based on the default Stomp Server implementation. `open static fun create(vertx: Vertx): StompServer` Creates a StompServer based on the default Stomp Server implementation, and use the default options.
handler | `abstract fun handler(handler: StompServerHandler): StompServer` Configures the StompServerHandler. You must calls this method before calling the `#listen()` method.
isListening | `abstract fun isListening(): Boolean` Checks whether or not the server is listening.
listen | `abstract fun listen(port: Int): StompServer` Connects the STOMP server to the given port. `abstract fun listen(port: Int, host: String): StompServer` Connects the STOMP server to the given port / interface. `abstract fun listen(): StompServer` Connects the STOMP server to the port / host configured in the server options. `abstract fun listen(handler: Handler<AsyncResult<StompServer>>): StompServer` Connects the STOMP server default port (61613) and network interface (`0.0.0.0`). Once the socket it bounds calls the given handler with the result. The result may be a failure if the socket is already used. `abstract fun listen(port: Int, handler: Handler<AsyncResult<StompServer>>): StompServer` Connects the STOMP server to the given port. This method use the default host (`0.0.0.0`). Once the socket it bounds calls the given handler with the result. The result may be a failure if the socket is already used. `abstract fun listen(port: Int, host: String, handler: Handler<AsyncResult<StompServer>>): StompServer` Connects the STOMP server to the given port / interface. Once the socket it bounds calls the given handler with the result. The result may be a failure if the socket is already used.
options | `abstract fun options(): StompServerOptions`
stompHandler | `abstract fun stompHandler(): StompServerHandler`
vertx | `abstract fun vertx(): Vertx`
webSocketHandler | `abstract fun webSocketHandler(): Handler<ServerWebSocket>` Gets the Handler able to manage web socket connections. If the web socket bridge is disabled, it returns `null`.
writingFrameHandler | `abstract fun writingFrameHandler(handler: Handler<ServerFrame>): StompServer` Configures the handler that is invoked every time a frame is going to be written to the "wire". It lets you log the frames, but also adapt the frame if needed.