code: @Override
      public void sessionClosed(IoSession session) throws Exception {
          log.debug("Session closed");
          String sessionId = (String) session.getAttribute(RTMPConnection.RTMP_SESSION_ID);
          if (sessionId != null) {
              log.trace("Session id: {}", sessionId);
              RTMPMinaConnection conn = (RTMPMinaConnection) getConnectionManager(session).getConnectionBySessionId(sessionId);
              if (conn != null) {
                  conn.sendPendingServiceCallsCloseError();
                  // fire-off closed event
                  handler.connectionClosed(conn);
                  // clear any session attributes we may have previously set
                  session.removeAttribute(RTMPConnection.RTMP_HANDLER);
                  session.removeAttribute(RTMPConnection.RTMP_HANDSHAKE);
                  session.removeAttribute(RTMPConnection.RTMPE_CIPHER_IN);
                  session.removeAttribute(RTMPConnection.RTMPE_CIPHER_OUT);
              } else {
                  log.warn("Connection was null in session");
              }
          } else {
              log.debug("Connections session id was null in session, may already be closed");
          }
      }
docs: {@inheritDoc}