Skip to Content [alt-c]
In reply to Comment by Andrew Ayer
Unfortunately, Go provides no way to detect when a connection has been fully closed without trying to write at least one byte to it
Thank you! As a newcomer to Go, this problem drove me crazy. In Java, if I were running a select loop, I can just get an event that the remote end disconnected. I'm writing a HTTP (1.1) proxy for delivering webhooks in Go as a side project, and the way I "solve" this problem is by having an idle read timeout on the connection. Of course, this only works because it's HTTP, and the intended behavior of my proxy is to close the connection after a request-response interaction anyway.
I'm exploring possible solutions and plan to publish a blog post about it
Very much looking forward to it!
Reply
Your comment will be public. To contact me privately, email me. Please keep your comment polite, on-topic, and comprehensible. Your comment may be held for moderation before being published.
Your Name: (Optional; will be published)
Your Email Address: (Optional; will not be published)
Your Website: (Optional; will be published)
>
monospaced
Post a Reply
Your comment will be public. To contact me privately, email me. Please keep your comment polite, on-topic, and comprehensible. Your comment may be held for moderation before being published.