Example #1
0
def create_sensor_server(sensor):
    logging.info('Creating voltmeter server')
    args = Namespace('localhost', 5679)
    sensor_server = sim_instrument.main_tcp(sensor, args)
    logging.info('Voltmeter: interrupt the program with Ctrl-C')
    try:
        sensor_server.serve_forever()
    except KeyboardInterrupt:
        logging.info('Voltmeter: Ending')
    finally:
        sensor_server.shutdown()
Example #2
0
def create_actuator_server(actuator):
    logging.info('Creating fungen server')
    args = Namespace('localhost', 5678)
    actuator_server = sim_instrument.main_tcp(actuator, args)
    logging.info('Fungen: interrupt the program with Ctrl-C')
    try:
        actuator_server.serve_forever()
    except KeyboardInterrupt:
        logging.info('Fungen: Ending')
    finally:
        actuator_server.shutdown()