(**kwargs)
Perform a tcp connection to the specified IP and PORT
Perform a tcp connection to the specified IP and PORT
Perform a tcp connection to the specified IP and PORT
def check(**kwargs):
    """ Perform a tcp connection to the specified IP and PORT """
    jdata = kwargs['jdata']

    # Build socket Connection
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    # Sets realistic timeout value
    s.settimeout(5)
    try:
        result = s.connect_ex((jdata['data']['ip'], int(jdata['data']['port'])))
    except socket.error:
        return False

    if result != 0:
        return False
    else:
        return True
def check ( * * kwargs ) : jdata = kwargs [ 'jdata' ] # Build socket Connection s = socket . socket ( socket . AF_INET , socket . SOCK_STREAM ) # Sets realistic timeout value s . settimeout ( 5 ) try : result = s . connect_ex ( ( jdata [ 'data' ] [ 'ip' ] , int ( jdata [ 'data' ] [ 'port' ] ) ) ) except socket . error : return False if result != 0 : return False else : return True