Explorar o código

for some reasons you cant await async methods using a variable holding the method. curio.spawn() hopefully works

digital %!s(int64=7) %!d(string=hai) anos
pai
achega
838194b09f
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      network/__init__.py

+ 3 - 1
network/__init__.py

@@ -116,7 +116,8 @@ class ConnHandler(object):
     """
     def __init__(self, socket, addr, server):
         super(ConnHandler, self).__init__(socket,addr,server)
-        await self.welcome_client()
+        task = await curio.spawn(self.welcome_client)
+        task.join()
 
     async def disconnect(self):
         """
@@ -169,6 +170,7 @@ class ConnHandler(object):
         """
         This method can be used to send a welcome message to the client.
         """
+        self.send("Welcome client, this is the server sending!")
         pass