close method
Override close() to ensure keep-alive timer is stopped
Implementation
@override
void close() {
// Stop keep-alive timer to prevent resource leak
stopKeepAlive();
// only if already not send the close i send it
if(open) sendClosed();
// Call parent close() to remove callbacks
super.close();
}