@@ -37,7 +37,7 @@ class AsyncioBackend(AbstractIRCBackend):
3737 """IRC Backend implementation using :mod:`asyncio`.
3838
3939 :param bot: an instance of a bot that uses the backend
40- :param host: hostname to connect to
40+ :param host: hostname/IP to connect to
4141 :param port: port to connect to
4242 :param source_address: optional source address as a tuple of
4343 ``(host, port)``
@@ -128,7 +128,7 @@ def _ping_callback(self) -> None:
128128 self .send_ping (self ._host )
129129
130130 def _timeout_callback (self ) -> None :
131- # cancel every other tasks
131+ # cancel other tasks
132132 for task in [self ._ping_task , self ._read_task ]:
133133 if task is not None :
134134 task .cancel ()
@@ -195,12 +195,12 @@ async def send(self, data: bytes) -> None:
195195 async def read_forever (self ) -> None :
196196 """Main reading loop of the backend.
197197
198- This listens to the reader for IRC line, decodes the line, and pass
199- that to
198+ This listens to the reader for an incoming IRC line, decodes the data,
199+ and passes it to
200200 :meth:`bot.on_message(data) <sopel.irc.AbstractBot.on_message>`, until
201201 the reader reaches the EOF (i.e. connection closed).
202202
203- It manages timeout by scheduling two tasks:
203+ It manages connection timeouts by scheduling two tasks:
204204
205205 * a PING task, that will send a PING to the server as defined by
206206 the ping interval (from the configuration)
@@ -239,18 +239,18 @@ async def read_forever(self) -> None:
239239
240240 # connection is active: reset timeout tasks
241241 self ._reset_timeout_tasks ()
242- # check content
243242
243+ # check content
244244 if not line :
245245 LOGGER .debug ('No data received.' )
246246 continue
247247
248- # use bot's callback
248+ # use bot's callbacks
249249 data = self .decode_line (line )
250250 self .bot .log_raw (data , '<<' )
251251 self .bot .on_message (data )
252252
253- # cancel timeout tasks
253+ # cancel timeout tasks when reading loop ends
254254 self ._cancel_timeout_tasks ()
255255
256256 # run & connection
@@ -286,7 +286,7 @@ def get_connection_kwargs(self) -> Dict:
286286 async def _run_forever (self ) -> None :
287287 self ._loop = asyncio .get_running_loop ()
288288
289- # register signals handlers
289+ # register signal handlers
290290 for quit_signal in QUIT_SIGNALS :
291291 self ._loop .add_signal_handler (quit_signal , self ._signal_quit )
292292 for restart_signal in RESTART_SIGNALS :
0 commit comments