code: def _do_tcp_check(self, ip, results):
          
          try:
              sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
              sock.settimeout(1)
              sock.connect((ip, self.conf['tcp_check_port']))
          except:
              # Any problem during the connection attempt? We won't diagnose it,
              # we just indicate failure by adding the IP to the list
              results.append(ip)
          finally:
              sock.close()
docs: Attempt to establish a TCP connection.
  
          If not successful, record the IP in the results dict.
  
          Always closes the connection at the end.