MXS-2122: Close listener socket on destruction

Even though directly closing the socket is not very neat in the
architectural sense of things, it allows the best of both worlds: the
socket is instantly closed and is open for reuse while the listener struct
is still available as a reference.

This change needs to be revised when the listeners are refactored into
separate objects.

Updated documentation to reflect the change in behavior.
This commit is contained in:
Markus Mäkelä
2018-10-29 16:05:04 +02:00
parent 47d2898818
commit cd92b6d4d7
6 changed files with 20 additions and 19 deletions

View File

@ -34,11 +34,7 @@ exports.builder = function(yargs) {
})
})
.command('listener <service> <name>', 'Destroy an unused listener', function(yargs) {
return yargs.epilog('Destroying a monitor causes it to be removed on the next restart. ' +
'Destroying a listener at runtime stops it from accepting new ' +
'connections but it will still be bound to the listening socket. This ' +
'means that new listeners cannot be created to replace destroyed listeners ' +
'without restarting MaxScale.')
return yargs.epilog('Destroying a listener closes the listening socket, opening it up for reuse.')
.usage('Usage: destroy listener <service> <name>')
}, function(argv) {
maxctrl(argv, function(host) {