I think we have to provide a KeepAliveManager to be used by management HTTP2 Connection, It does keepalive ping and close the connection when it does't received any response in a period of time.
It has the following benefit:
- It could reduce the number of idle connection and system resource load.
- It could also detect broken socket in certain service.
5条答案
按热度按时间p4rjhz4m1#
Aggreed !
Could you provide a description when should send a
keepalive ping
and when turns toIDLE
?When sending a new request , will the connnection reconnect and turn to active?
jutyujz02#
I talk about something what I understanding.
IDLE
when connection have not any active stream. and KeepAliveManager might schedule to send ping frame to keep connection alive. and stop send ping frame when connection have any active stream.Aggreed ! Could you provide a description when should send a
keepalive ping
and when turns toIDLE
? When sending a new request , will the connnection reconnect and turn to active?7cwmlq893#
Keepalive should not be infinite and parameters should be configurable.
At the same time, after entering the
Idle
state, a timeout period should be set to close the connection.vecaoik14#
It would close the connection when it have not received ping ack timeout.
Same question that if a connection has no active stream , it should be closed and reconnect when new request arrived.
zbsbpyhn5#
Keepalive should not be infinite and parameters should be configurable.
Of cause