From 6f94cc738a6e2e68b6f2972d44ed45511459eb47 Mon Sep 17 00:00:00 2001 From: Christina Date: Tue, 21 Jan 2025 17:19:21 +0100 Subject: [PATCH] rebase --- src/lavinmq/launcher.cr | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/lavinmq/launcher.cr b/src/lavinmq/launcher.cr index 647864101d..8a71e2e6c7 100644 --- a/src/lavinmq/launcher.cr +++ b/src/lavinmq/launcher.cr @@ -136,13 +136,13 @@ module LavinMQ private def start_listeners(amqp_server, http_server) if @config.amqp_port > 0 - spawn amqp_server.listen(@config.amqp_bind, @config.amqp_port, :amqp), + spawn amqp_server.listen(@config.amqp_bind, @config.amqp_port, Server::Protocol::AMQP), name: "AMQP listening on #{@config.amqp_port}" end if @config.amqps_port > 0 if ctx = @tls_context - spawn amqp_server.listen_tls(@config.amqp_bind, @config.amqps_port, ctx, :amqp), + spawn amqp_server.listen_tls(@config.amqp_bind, @config.amqps_port, ctx, Server::Protocol::AMQP), name: "AMQPS listening on #{@config.amqps_port}" end end @@ -152,7 +152,7 @@ module LavinMQ end unless @config.unix_path.empty? - spawn amqp_server.listen_unix(@config.unix_path, :amqp), name: "AMQP listening at #{@config.unix_path}" + spawn amqp_server.listen_unix(@config.unix_path, Server::Protocol::AMQP), name: "AMQP listening at #{@config.unix_path}" end if @config.http_port > 0 @@ -173,23 +173,18 @@ module LavinMQ end if @config.mqtt_port > 0 - spawn amqp_server.listen(@config.mqtt_bind, @config.mqtt_port, :mqtt), - name: "MQTT listening on #{@config.mqtt_port}" - end - - if @config.mqtts_port > 0 - spawn amqp_server.listen(@config.mqtt_bind, @config.mqtt_port, :mqtt), + spawn amqp_server.listen(@config.mqtt_bind, @config.mqtt_port, Server::Protocol::MQTT), name: "MQTT listening on #{@config.mqtt_port}" end if @config.mqtts_port > 0 if ctx = @tls_context - spawn @amqp_server.listen_tls(@config.mqtt_bind, @config.mqtts_port, ctx, Server::Protocol::MQTT), + spawn amqp_server.listen_tls(@config.mqtt_bind, @config.mqtts_port, ctx, Server::Protocol::MQTT), name: "MQTTS listening on #{@config.mqtts_port}" end end - unless @config.mqtt_unix_path.empty? - spawn @amqp_server.listen_unix(@config.mqtt_unix_path, Server::Protocol::MQTT), name: "MQTT listening at #{@config.mqtt_unix_path}" + unless @config.unix_path.empty? + spawn amqp_server.listen_unix(@config.mqtt_unix_path, Server::Protocol::MQTT), name: "MQTT listening at #{@config.unix_path}" end end