diff options
author | Sébastien Dailly <sebastien@chimrod.com> | 2024-07-05 09:57:26 +0200 |
---|---|---|
committer | Sébastien Dailly <sebastien@chimrod.com> | 2024-07-05 09:57:26 +0200 |
commit | cc84f87d61c538a8f425a4cf67d5d62e34081d65 (patch) | |
tree | 4a09acbd9b2df1591a869365818d366f3a50400b /socketserver.py | |
parent | 463acffe16ead0b345ba48cd6c9c94713974185c (diff) |
Updated the server socket
Diffstat (limited to 'socketserver.py')
-rwxr-xr-x | socketserver.py | 10 |
1 files changed, 10 insertions, 0 deletions
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:
|