code: public void close() {
          readyState = ReadyState.CLOSING;
  
          try {
              webSocketSession.close(new CloseReason(CloseReason.CloseCodes.NORMAL_CLOSURE, null));
          } catch (IOException e) {
              e.printStackTrace();
          }
      }
docs: Shutting down the current connection.