class_docstr: ChatServiceMessageSocket is a wrapper around websocket to forward messages from the
  remote server to the ChatServiceManager.
class_docstr_tok: ["ChatServiceMessageSocket","is","a","wrapper","around","websocket","to","forward","messages","from","the","remote","server","to","the","ChatServiceManager","."]
code: def _ensure_closed(self):
      try:
          self.ws.close()
      except websocket.WebSocketConnectionClosedException:
          pass
  
file_path: ParlAI/parlai/chat_service/core/socket.py
imports: import errno
  import json
  import logging
  import threading
  import time
  import websocket
  import parlai.chat_service.utils.logging
label_desc: Use image node_id 3 for calling the ChatServiceMessageSocket obj's underlying member method code with example usage: obj._ensure_closed() without return types