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

Make Reader unusable after io.EOF and Writer unusable after Close #73

Closed
nhooyr opened this issue Apr 27, 2019 · 2 comments
Closed

Make Reader unusable after io.EOF and Writer unusable after Close #73

nhooyr opened this issue Apr 27, 2019 · 2 comments
Milestone

Comments

@nhooyr
Copy link
Contributor

nhooyr commented Apr 27, 2019

I originally did not do this because I didn't want them to hold state so they could be stored as a value inside the interface{} but that isn't possible, Go is allocating it on the heap for me as interface{} can only contain a pointer.

@nhooyr nhooyr added this to the v0.3.0 milestone Apr 27, 2019
@nhooyr
Copy link
Contributor Author

nhooyr commented Apr 27, 2019

Something else I want to do is to remove the read and write loop goroutines. The goroutine that wants to write/read should hold the lock itself.

@nhooyr
Copy link
Contributor Author

nhooyr commented Apr 29, 2019

Ok I got it, we still need another goroutine to close the connection. What we should do is have the extra loop goroutines cancel the connection instead of the calling goroutine. Would simplify code big time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant