RefactoringRope/JsonClient.py

branch
server_client_variant
changeset 192
20950ed6b384
parent 173
2cdb7c48b719
child 203
c38750e1bafd
--- a/RefactoringRope/JsonClient.py	Sun Sep 24 17:10:48 2017 +0200
+++ b/RefactoringRope/JsonClient.py	Sun Sep 24 19:27:30 2017 +0200
@@ -25,7 +25,7 @@
     """
     Class implementing the JSON based client base class.
     """
-    def __init__(self, host, port):
+    def __init__(self, host, port, idString=""):
         """
         Constructor
         
@@ -33,9 +33,15 @@
         @type str
         @param port port of the background service
         @type int
+        @param idString assigned client id to be sent back to the server in
+            order to identify the connection
+        @param str
         """
         self.__exitClient = False
         self.__connection = socket.create_connection((host, port))
+        if idString:
+            reply = idString + '\n'
+            self.__connection.sendall(reply.encode('utf8', 'backslashreplace'))
     
     def sendJson(self, command, params):
         """

eric ide

mercurial