I have encountered the problem using example that exports Session object. Connection sends close notification before channels shutdown. Client must continue to check for channel notifications before trying to reconnect. If client fails to do that channels will not be closed, ie channel destructor will block on notification sending.
I would recommend a little modification to the connection shutdown method, that is channels shutdown as a first action in the connection destructor and send notifications after that.
Also, I would recommend to check for closed session in openChannel() function. That is, there is no point to allocate new channel for closed connection.
I have encountered the problem using example that exports Session object. Connection sends close notification before channels shutdown. Client must continue to check for channel notifications before trying to reconnect. If client fails to do that channels will not be closed, ie channel destructor will block on notification sending. I would recommend a little modification to the connection shutdown method, that is channels shutdown as a first action in the connection destructor and send notifications after that. Also, I would recommend to check for closed session in openChannel() function. That is, there is no point to allocate new channel for closed connection.