def METHOD_NAME(self, TCPCoTPort, IP):
    try:
        if IP == "0.0.0.0":
            s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
            s.connect(('10.255.255.255', 1))
            IP = s.getsockname()[0]
        else:
            pass
        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        sock.connect((IP, TCPCoTPort))
        sock.send(b'TEST')
        returnMessage = sock.recv(100)
        sock.close()
        if returnMessage == b'success':
            return "on"
        else:
            return "off"
    except Exception as e:
        return "off"