MXS-2196: Use smart pointers for lifetime management
The listeners no longer internally track whether they are active or not. All of the heavy lifting is now done by std::shared_ptr.
This commit is contained in:
@ -63,6 +63,16 @@ public:
|
||||
const std::string& auth_options,
|
||||
SSL_LISTENER* ssl);
|
||||
|
||||
/**
|
||||
* Destroy a listener
|
||||
*
|
||||
* This removes the listener from the global list of active listeners. Once destroyed, the port used
|
||||
* by a listener is open for immediate reuse.
|
||||
*
|
||||
* @param listener Listener to destroy
|
||||
*/
|
||||
static void destroy(const SListener& listener);
|
||||
|
||||
/**
|
||||
* Start listening on the configured port
|
||||
*
|
||||
@ -84,14 +94,6 @@ public:
|
||||
*/
|
||||
bool start();
|
||||
|
||||
/**
|
||||
* Closes a listener
|
||||
*
|
||||
* This closes the network socket the listener listens on to allow immediate reuse of it. The listener
|
||||
* instance can remain if there are open sessions for it.
|
||||
*/
|
||||
void close();
|
||||
|
||||
/**
|
||||
* Listener name
|
||||
*/
|
||||
@ -132,18 +134,6 @@ public:
|
||||
*/
|
||||
const char* state() const;
|
||||
|
||||
/**
|
||||
* Whether the listener is active
|
||||
*/
|
||||
bool is_active() const;
|
||||
|
||||
/**
|
||||
* Deactivate the listener
|
||||
*
|
||||
* TODO: Remove and deactivate via removal from global listener list
|
||||
*/
|
||||
void deactivate();
|
||||
|
||||
/**
|
||||
* The SSL_LISTENER object
|
||||
*/
|
||||
@ -221,15 +211,6 @@ private:
|
||||
*/
|
||||
bool listener_serialize(const SListener& listener);
|
||||
|
||||
/**
|
||||
* @brief Free a listener
|
||||
*
|
||||
* The listener must be destroyed before it can be freed.
|
||||
*
|
||||
* @param listener Listener to free
|
||||
*/
|
||||
void listener_free(const SListener& listener);
|
||||
|
||||
/**
|
||||
* Find a listener
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user