diff --git a/server/core/internal/service.hh b/server/core/internal/service.hh index eb6552628..ec7b1519f 100644 --- a/server/core/internal/service.hh +++ b/server/core/internal/service.hh @@ -309,15 +309,6 @@ Service* service_internal_find(const char* name); */ bool serviceHasBackend(Service* service, SERVER* server); -/** - * @brief Start new a listener for a service - * - * @param service Service where the listener is linked - * @param port Listener to start - * @return True if listener was started - */ -bool serviceLaunchListener(Service* service, const SListener& port); - /** * @brief Find listener with specified properties. * diff --git a/server/core/service.cc b/server/core/service.cc index 3337230c8..df9f6a2f7 100644 --- a/server/core/service.cc +++ b/server/core/service.cc @@ -313,19 +313,6 @@ bool service_isvalid(Service* service) service) != this_unit.services.end(); } -/** - * Start an individual port/protocol pair - * - * @param service The service - * @param port The port to start - * @return The number of listeners started - */ -static int serviceStartPort(Service* service, const SListener& port) -{ - mxb_assert(service && service->router && service->router_instance); - return port->listen(); -} - /** * Start all ports for a service. * serviceStartAllPorts will try to start all listeners associated with the service. @@ -348,7 +335,10 @@ int serviceStartAllPorts(Service* service) break; } - listeners += serviceStartPort(service, listener); + if (listener->listen()) + { + ++listeners; + } } if (service->state == SERVICE_STATE_FAILED) @@ -420,22 +410,6 @@ int serviceInitialize(Service* service) return listeners; } -bool serviceLaunchListener(Service* service, const SListener& port) -{ - mxb_assert(service->state != SERVICE_STATE_FAILED); - bool rval = true; - LockGuard guard(service->lock); - - if (serviceStartPort(service, port) == 0) - { - /** Failed to start the listener */ - rval = false; - } - - - return rval; -} - bool serviceStopListener(SERVICE* svc, const char* name) { auto listener = listener_find(name);