1# Copyright (c) 2023, Bjarki Arge Andreasen 2# SPDX-License-Identifier: Apache-2.0 3 4import signal 5 6from te_udp_echo import TEUDPEcho 7from te_udp_receive import TEUDPReceive 8 9udp_echo = TEUDPEcho() 10udp_receive = TEUDPReceive() 11 12udp_echo.start() 13udp_receive.start() 14 15print("started") 16 17 18def terminate_handler(a, b): 19 udp_echo.stop() 20 udp_receive.stop() 21 print("stopped") 22 23 24signal.signal(signal.SIGTERM, terminate_handler) 25signal.signal(signal.SIGINT, terminate_handler) 26