From cc84f87d61c538a8f425a4cf67d5d62e34081d65 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Fri, 5 Jul 2024 09:57:26 +0200 Subject: Updated the server socket --- socketserver.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'socketserver.py') diff --git a/socketserver.py b/socketserver.py index 0a7e9d4..57000d8 100755 --- a/socketserver.py +++ b/socketserver.py @@ -48,6 +48,7 @@ class Handler(object): self.socket = socket.socket() self.socket.bind((configuration["host"], int(configuration["port"]))) + print("Listening on", configuration["host"], ":",int(configuration["port"])) self.socket.listen(100) self.socket.setblocking(False) c = waitEvent() @@ -119,12 +120,21 @@ class Handler(object): return if self.application_name is not None: + # As we have a name in the configuration to associate with, use + # this name as a reference title = self.application_name else: # Associate the layout with the current window title = component.queryUtility(desktopEvent.IDesktop).getForegroundWindowTitle() self.layout_queue.put((js, title)) + # The application name is hardcoded in the code, and should be reported + # in the configuration or somewhere else. + + # The name of the current application is not reliable because the + # message can be send with some lattency. + self.layout_queue.put((js, self.application_name)) + def _send(self:object, conn:socket, mask:int, text) -> None: """ Internal method used to dispatch the message to the socket. """ try: -- cgit v1.2.3