Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
kickster97 committed Jan 21, 2025
1 parent 9f770aa commit 6f94cc7
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions src/lavinmq/launcher.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down

0 comments on commit 6f94cc7

Please sign in to comment.