200 }, |
200 }, |
201 ) |
201 ) |
202 return {} |
202 return {} |
203 |
203 |
204 jsonStr = data.decode("utf8", "backslashreplace") |
204 jsonStr = data.decode("utf8", "backslashreplace") |
205 print("Eric Server Receive:", jsonStr) # for debugging |
205 print("Eric Server Receive:", jsonStr) # for debugging # noqa: M801 |
206 try: |
206 try: |
207 return json.loads(jsonStr.strip()) |
207 return json.loads(jsonStr.strip()) |
208 except (TypeError, ValueError) as err: |
208 except (TypeError, ValueError) as err: |
209 self.sendJson( |
209 self.sendJson( |
210 category=EricRequestCategory.Error, |
210 category=EricRequestCategory.Error, |
322 connection, address = sock.accept() # Should be ready to read |
322 connection, address = sock.accept() # Should be ready to read |
323 if self.__connection is None: |
323 if self.__connection is None: |
324 print(f"'eric-ide' connection from {address[0]}, port {address[1]}") |
324 print(f"'eric-ide' connection from {address[0]}, port {address[1]}") |
325 # noqa: M801 |
325 # noqa: M801 |
326 self.__connection = connection |
326 self.__connection = connection |
327 ##self.__connection.setblocking(False) |
|
328 data = types.SimpleNamespace( |
327 data = types.SimpleNamespace( |
329 name="eric-ide", address=address, handler=self.__serviceIdeConnection |
328 name="eric-ide", address=address, handler=self.__serviceIdeConnection |
330 ) |
329 ) |
331 events = selectors.EVENT_READ |
330 events = selectors.EVENT_READ |
332 self.__selector.register(self.__connection, events, data=data) |
331 self.__selector.register(self.__connection, events, data=data) |