def single_client_test(host, cycles):
 logger = log_to_stderr()
 logger.setLevel(logging.DEBUG)
 logger.debug(('starting worker: %d' % os.getpid()))
 try:
  count = 0
  client = ModbusTcpClient(host)
  while (count < cycles):
   result = client.read_holding_registers(10, 1).getRegister(0)
   count += 1
 except:
  logger.exception('failed to run test successfully')
 logger.debug(('finished worker: %d' % os.getpid()))

def single_client_test ( host , cycles ) : logger = log_to_stderr ( ) logger . setLevel ( logging . DEBUG ) logger . debug ( ( 'starting worker: %d' % os . getpid ( ) ) ) try : count = 0 client = ModbusTcpClient ( host ) while ( count < cycles ) : result = client . read_holding_registers ( 10 , 1 ) . getRegister ( 0 ) count += 1 except : logger . exception ( 'failed to run test successfully' ) logger . debug ( ( 'finished worker: %d' % os . getpid ( ) ) )
performs a single threaded test of a synchronous client against the specified host .