can optionally notifyDisconnect when closing a connection

This commit is contained in:
Robinson 2023-08-09 22:12:52 -06:00
parent 1ded010b89
commit 2b5e943369
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C
1 changed files with 4 additions and 1 deletions

View File

@ -328,9 +328,12 @@ open class Connection(connectionParameters: ConnectionParams<*>) {
// NOTE: any waiting RMI messages that are in-flight will terminate when they time-out (and then do nothing)
// NOTE: notifyDisconnect() is called inside closeAction()!!
if (notifyDisconnect) {
// if there are errors within the driver, we do not want to notify disconnect, as we will automatically reconnect.
endPoint.listenerManager.notifyDisconnect(this)
}
endPoint.removeConnection(this)
endPoint.listenerManager.notifyDisconnect(this)
val connection = this