()
return retVal
Get local IP address (exposed to the remote/target)
Get local IP address (exposed to the remote/target)
Get local IP address ( exposed to the remote / target )
def getLocalIP():
    """
    Get local IP address (exposed to the remote/target)
    """

    retVal = None

    try:
        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        s.connect((conf.hostname, conf.port))
        retVal, _ = s.getsockname()
        s.close()
    except:
        debugMsg = "there was an error in opening socket "
        debugMsg += "connection toward '%s'" % conf.hostname
        logger.debug(debugMsg)

    return retVal
def getLocalIP ( ) : retVal = None try : s = socket . socket ( socket . AF_INET , socket . SOCK_STREAM ) s . connect ( ( conf . hostname , conf . port ) ) retVal , _ = s . getsockname ( ) s . close ( ) except : debugMsg = "there was an error in opening socket " debugMsg += "connection toward '%s'" % conf . hostname logger . debug ( debugMsg ) return retVal