mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-20 22:37:44 +00:00
Code review fixes
This commit is contained in:
@@ -163,9 +163,10 @@ class TelnetServer:
|
||||
# Ensure ASCII formatting for telnet clients
|
||||
encoded_line = self._format_dxspider_spot(spot).encode("ascii", errors="ignore")
|
||||
|
||||
# Try to write to all clients, and in the process find the ones that are disconnected
|
||||
# Try to write to all clients, and in the process find the ones that are disconnected. Iterate over a copy
|
||||
# since a new client can connect (mutating self._clients) while we're awaiting a write below.
|
||||
disconnected_clients = set()
|
||||
for writer in self._clients:
|
||||
for writer in list(self._clients):
|
||||
try:
|
||||
writer.write(encoded_line)
|
||||
await writer.drain()
|
||||
|
||||
Reference in New Issue
Block a user