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

Added closing support for FrameStreamSockInput #50

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

noxer
Copy link

@noxer noxer commented Apr 25, 2023

Currently the FrameStreamSockInput does not support being closed. Depending on the use case, this may be undesirable since it may leak go-routines. Further, a broken listener (for whatever reason) lead to a busy loop where ReadInto would spam "accept failed".

This PR changes the following:

  • ReadInto now keeps track of active connections
  • Closing the listener now leads to ReadInto returning
  • Before returning, ReadInto will close all accepted connections
  • Before returning, ReadInto will close the wait channel
  • Added the Close method, which closes the listener
  • The Wait method now waits for wait to be closed
  • Added and updated comments

I'd be happy about feedback on the code or suggestions for further improvements.

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

Successfully merging this pull request may close these issues.

1 participant