http2 ping

273 views
Skip to first unread message

jonathan...@gmail.com

unread,
Apr 13, 2016, 7:25:55 PM4/13/16
to golang-nuts
I have looked through the stdlib code but cannot figure out how often or what initiates a ping?

jonathan...@gmail.com

unread,
Apr 13, 2016, 10:18:00 PM4/13/16
to golang-nuts, jonathan...@gmail.com
The spec doesn't seem to mention much about the pings except the wire format but nothing about how often, if they are required, which side initiates etc.

I am guessing golang responds on the sever side but doesn't send them on the client side?

Dave Cheney

unread,
Apr 13, 2016, 11:42:35 PM4/13/16
to golang-nuts
Hello,

In the spirit of the X/Y problem, if you could answer your question about http/2 pings, what would your next move be?

Thanks

jonathan...@gmail.com

unread,
Apr 14, 2016, 2:07:56 AM4/14/16
to golang-nuts
Haha I love this game, is the correct answer that I would encode information via the frequency I send pings with?! :D:D


So I have some tls connections between machines, some use http2.ServeConn and act as the server on their connection the other sides of those connections put that connection in a http2.ClientConnPool (with a wrapper over the net.Conn to make it non closing). What I need to know is whether or not there is pinging happening and at what rate to know whether I need to send across requests for the purpose of detecting a dead connection in a reasonable amount of time. Was that what you were hoping I would say or hoping I wouldn't? :)

Dave Cheney

unread,
Apr 14, 2016, 5:20:45 AM4/14/16
to golang-nuts
The bottom line is, you don't know if a network connection, tcp or tunnelled over some other protocol, will work unless you use it. Pings and keep alive and that jazz are just window dressing, they don't make the connection any more reliable. Network errors happen, the higher level protocol needs to be able to retry requests.
Reply all
Reply to author
Forward
0 new messages