class_docstr: This is like :mod:`pexpect.fdpexpect` but uses the cross-platform python socket api,
  rather than the unix-specific file descriptor api. Thus, it works with
  remote connections on both unix and windows.
class_docstr_tok: ["This","is","like",":","mod",":","`","pexpect.fdpexpect","`","but","uses","the","cross-platform","python","socket","api",",","rather","than","the","unix-specific","file","descriptor","api",".","Thus",",","it","works","with","remote","connections","on","both","unix","and","windows","."]
docstr: Close the socket.
  
  Calling this method a second time does nothing, but if the file
  descriptor was closed elsewhere, :class:`OSError` will be raised.
docstr_tok: ["Close","the","socket",".","Calling","this","method","a","second","time","does","nothing",",","but","if","the","file","descriptor","was","closed","elsewhere",",",":","class",":","`","OSError","`","will","be","raised","."]
code: def close(self):
      """Close the socket.
  
      Calling this method a second time does nothing, but if the file
      descriptor was closed elsewhere, :class:`OSError` will be raised.
      """
      if self.child_fd == -1:
          return
  
      self.flush()
      self.socket.shutdown(socket.SHUT_RDWR)
      self.socket.close()
      self.child_fd = -1
      self.closed = True
  
file_path: catboost/contrib/python/pexpect/py3/pexpect/socket_pexpect.py
imports: import socket
  from contextlib import contextmanager
  from .exceptions import TIMEOUT, EOF
  from .spawnbase import SpawnBase
label_desc: Use image node_id 2 for calling the SocketSpawn obj's underlying member method code with example usage: obj.close() without return types