def run_with_no_loop():
    """
    ModbusClient Factory creates a loop.
    :return:
    """
    loop, client = ModbusClient(schedulers.ASYNC_IO, port=5020)
    loop.run_until_complete(start_async_test(client.protocol))
    loop.close()
Example #2
0
def run_with_no_loop():
    """
    ModbusClient Factory creates a loop.
    :return:
    """
    loop, client = ModbusClient(schedulers.ASYNC_IO, port=5020)
    loop.run_until_complete(start_async_test(client.protocol))
    loop.close()
Example #3
0
def run_with_no_loop():
    """
    ModbusClient Factory creates a loop.
    :return:
    """
    log.debug("---------------------RUN_WITH_NO_LOOP-----------------")
    loop, client = ModbusClient(schedulers.ASYNC_IO, port=5020)
    loop.run_until_complete(start_async_test(client.protocol))
    loop.close()
    log.debug("--------DONE RUN_WITH_NO_LOOP-------------")
    log.debug("")
Example #4
0
def run_with_no_loop():
    """
    ModbusClient Factory creates a loop.
    :return:
    """
    clientSocket = socket.socket()
    host = os.getenv('IP_CLIENT')
    port = 15021
    clientSocket.connect((host, port))
    message = clientSocket.recv(1024).decode("UTF-8")
    if message == None:
        print("Error en autenticacion")
        return

    log.debug("---------------------RUN_WITH_NO_LOOP-----------------")
    loop, client = ModbusClient(schedulers.ASYNC_IO,
                                host=os.getenv('IP_CLIENT'),
                                port=5020)
    loop.run_until_complete(start_async_test(client.protocol))
    loop.close()
    log.debug("--------DONE RUN_WITH_NO_LOOP-------------")
    log.debug("")