I am very interested in the idea to write a chat application. I've recently come across great tutorial at https://channels.readthedocs.io/en/latest/index.html using DjangoChannels All understood, wrote my own one (suppose the same as there), everything is working. However, I ran into a problem: when updating the chat page, the server throws this exception (and after that I can't send messages, so that's quite harmful):
Exception in callback AsyncioSelectorReactor.callLater.<locals>.run() at /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/twisted/internet/asyncioreactor.py:287
handle: <TimerHandle when=53.716773429 AsyncioSelectorReactor.callLater.<locals>.run() at /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/twisted/internet/asyncioreactor.py:287>
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/events.py", line 81, in _run
self._context.run(self._callback, *self._args)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/twisted/internet/asyncioreactor.py", line 290, in run
f(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/daphne/server.py", line 229, in application_checker
exception = application_instance.exception()
asyncio.exceptions.CancelledError
(I am using WebsocketConsumer
, python 3.8.2)
Actually, I suppose there is a problem with the disconnection with the server when updating the page. I tried to solve it myself but unfortunately didn't succeed :( Could anybody please help me?