Add telnet server

This commit is contained in:
Ian Renton
2026-09-11 15:55:57 +01:00
parent 04f5df5260
commit 5e56cd3b19
32 changed files with 222 additions and 35 deletions
+8 -2
View File
@@ -5,12 +5,13 @@ import signal
import sys
from core.cleanup import CLEANUP_TIMER
from core.config import LOG_LEVEL, SERVER_OWNER_CALLSIGN
from core.config import LOG_LEVEL, SERVER_OWNER_CALLSIGN, TELNET_SERVER_ENABLED, TELNET_SERVER_PORT
from core.constants import SOFTWARE_VERSION
from core.data_providers import DATA_PROVIDERS
from core.data_store import DATA_STORE
from core.status_reporter import StatusReporter
from server.webserver import WEB_SERVER
from telnetserver.telnetserver import TELNET_SERVER
from webserver.webserver import WEB_SERVER
logger = logging.getLogger(__name__)
@@ -20,6 +21,7 @@ def shutdown(_signum=None, _frame=None):
logger.info("Stopping program...")
WEB_SERVER.stop()
TELNET_SERVER.stop()
DATA_PROVIDERS.stop()
CLEANUP_TIMER.stop()
DATA_STORE.close()
@@ -60,6 +62,10 @@ if __name__ == "__main__":
# Set up the web server
WEB_SERVER.setup()
# Run the telnet server
if TELNET_SERVER_ENABLED:
TELNET_SERVER.start(port=TELNET_SERVER_PORT)
# Run the web server. This is the blocking call that keeps the application running in the main thread, so this must
# be the last thing we do. web_server.stop() triggers an await condition in the web server which finishes the main
# thread.