Closed mdlayher closed 5 years ago
Ping @aybabtme, @mxpv, and @pmorjan; I am curious if you have deployed this package with Go 1.12 in your environments.
@mdlayher I use 1.12 with your package and I'm totally happy with it. But I'm using it only at a commit before Accept() has changed. I still think Accept() should behave the same as other Accept methods in the std library and block. I guess most use cases are like this: listener. But I really don't want to complain. Also I currently don't use the timeout feature. Thanks.
@pmorjan my understanding is that with the changes made to 1.12, Accept should be blocking again. If it isn't, we should fix that. Can you confirm?
@mdlayher 1.12 does not make any difference. 4b12813 is the last commit where Accept blocks. fda437ec and later Accept does not block.
Confirmed here too. It would appear there's some work to be done yet. I'll start investigating.
It isn't clear to me how close we are to having this already done, but as of Go 1.12, we should be able to create:
net.Listener
that can accept and wait indefinitely without EAGAIN, but also be closed while blockingnet.Conn
that can have timeouts set and be closed concurrently (already done?)For the gist of how to do this, see: https://github.com/mdlayher/raw/commit/f434146a17ecdf185e28b9ae8457ef45ee82077a. I don't currently have an easy way to test this package, but perhaps I can get my hypervisor setup back up and running to do some verification of any required changes in a few days.
Or perhaps, everything will just work! We'll see.
I don't immediately have time to work on this, but I suspect folks who are using this in their projects will take a great interest in making timeouts work and providing added efficiency to their applications. :)
/cc @aybabtme @mxpv @pmorjan