src/eric7/RemoteServer/EricServer.py

branch
server
changeset 10630
552a790fd9bc
parent 10610
bb0149571d94
child 10633
dda7e43934dc
--- a/src/eric7/RemoteServer/EricServer.py	Tue Feb 27 15:05:53 2024 +0100
+++ b/src/eric7/RemoteServer/EricServer.py	Fri Mar 08 15:30:23 2024 +0100
@@ -73,7 +73,6 @@
             self.__coverageRequestHandler.handleRequest,
         )
 
-        # TODO: 'Project' handler not implemented yet
         # TODO: implement an 'EditorConfig' handler (?)
 
         self.__address = ("", port)
@@ -203,7 +202,7 @@
             return {}
 
         jsonStr = data.decode("utf8", "backslashreplace")
-        # - print("Eric Server Receive:", jsonStr)  # for debugging
+        print("Eric Server Receive:", jsonStr)  # for debugging
         try:
             return json.loads(jsonStr.strip())
         except (TypeError, ValueError) as err:
@@ -281,8 +280,10 @@
 
         self.__socket.listen(0)
         self.__socket.setblocking(False)
-        print(f"Listening for 'eric-ide' connections on {self.__socket.getsockname()}")
-        # noqa: M801
+        address = self.__socket.getsockname()
+        print(  # noqa: M801
+            f"Listening for 'eric-ide' connections on {address[0]}, port {address[1]}"
+        )
         data = types.SimpleNamespace(
             name="server", acceptHandler=self.__acceptIdeConnection
         )
@@ -320,10 +321,10 @@
         """
         connection, address = sock.accept()  # Should be ready to read
         if self.__connection is None:
-            print(f"'eric-ide' connection from {address[0]},  port {address[1]}")
+            print(f"'eric-ide' connection from {address[0]}, port {address[1]}")
             # noqa: M801
             self.__connection = connection
-            self.__connection.setblocking(False)
+            ##self.__connection.setblocking(False)
             data = types.SimpleNamespace(
                 name="eric-ide", address=address, handler=self.__serviceIdeConnection
             )
@@ -333,7 +334,7 @@
             self.__unregisterIdeSocket()
         else:
             print(  # noqa: M801
-                f"'eric-ide' connection from {address[0]},  port {address[1]} rejected"
+                f"'eric-ide' connection from {address[0]}, port {address[1]} rejected"
             )
             connection.close()
 
@@ -347,9 +348,9 @@
         if self.__connection is not None:
             self.__selector.unregister(self.__connection)
             try:
+                address = self.__connection.getpeername()
                 print(  # noqa: M801
-                    f"Closing 'eric-ide' connection to"
-                    f" {self.__connection.getpeername()}."
+                    f"Closing 'eric-ide' connection to {address[0]}, port {address[1]}."
                 )
                 self.__connection.shutdown(socket.SHUT_RDWR)
                 self.__connection.close()

eric ide

mercurial