Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: socket collections grow unchecked #6

Open
Beormund opened this issue Oct 13, 2022 · 0 comments
Open

BUG: socket collections grow unchecked #6

Beormund opened this issue Oct 13, 2022 · 0 comments

Comments

@Beormund
Copy link

Beormund commented Oct 13, 2022

uPyEcho/main.py

Lines 298 to 302 in e09c28d

if not data:
self.poller.remove(self, self.client_sockets[fileno])
self.client_sockets[fileno].close()
else:

self.client_sockets dictionary of sockets keeps growing unchecked. You need to pop each client socket when no data is received:

self.client_sockets.pop(fileno)

Also, in the poller.remove() function you need to remove the socket from self.targets:

uPyEcho/main.py

Lines 197 to 203 in e09c28d

def remove(self, target, socket=None):
if not socket:
socket = target.sockets()
if self.use_poll:
self.poller.unregister(socket)
# dbg("remove device on fileno: %s" % socket.fileno() )
gc.collect()

self.targets.pop(socket.fileno())
@Beormund Beormund changed the title BUG: Client sockets collection grows unchecked BUG: socket collections grow unchecked Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant