Browse Source

reverted changes from the the previous commits

digital 7 years ago
parent
commit
ed94eb52dd
1 changed files with 7 additions and 7 deletions
  1. 7 7
      network/__init__.py

+ 7 - 7
network/__init__.py

@@ -152,9 +152,7 @@ class ConnHandler(ConnHandlerBase):
         """
         if block_size == None:
             block_size = self.block_size
-        # we don't want to call recv of the current class, wich is this method
-        # instead call the recv method of the direct parent using super()
-        data_received = await super().recv(block_size=block_size)
+        data_received = await self.socket.recv(block_size=block_size)
         data_decoded = data_received.decode("utf-8")
         return data_decoded
 
@@ -167,11 +165,13 @@ class ConnHandler(ConnHandlerBase):
             lschat.info("server:"+log_msg)
         else:
             lschat.info("Server:"+data)
-        # we don't want to call send of the current class, wich is this method
-        # instead call the send method of the direct parent using super()
         data_encoded = bytes(data, "utf-8")
-        send_status = await super().send(data_encoded)
-        return send_status
+        try:
+            await self.socket.send(data_encoded)
+            return True
+        except Exception as e:
+            lch.error(e, exc_info=True)
+            return False
 
 
 class ConnHandlerEcho(ConnHandler):