Skip to Content [alt-c]
In reply to Comment by Reader Ameya
Thanks, Ameya! You raise a good point about leaking connections but it's unfortunately not that simple to fix. I want to avoid deadlines because the proxy should be able to handle any type of protocol, and some protocols might legitimately have long periods of inactivity. Instead, it should be the backend's responsibility to close idle connections and the proxy should detect when that has happened.
Unfortunately, Go provides no way to detect when a connection has been fully closed without trying to write at least one byte to it, which isn't sufficient because the proxy doesn't always have a byte to write. On Unix, closure can be detected without writing by polling the socket with events=0 and looking for POLLHUP in revents. I'm exploring possible solutions and plan to publish a blog post about it.
events=0
POLLHUP
revents
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.