Implementation of server enforcement of keepalive policy.
Server will close connection with a client that violates this policy.
Policy parameters:
- MinTime is the minimum amount of time a client should wait before sending a keepalive ping.
- If PermitWithoutStream true, server expects keepalive pings even when there are no active streams(RPCs).
The new logic added to the server does the following:
- Gracefully closes an idle connection after a duration of keepalive.MaxConnectionIdle.
- Gracefully closes any connection after a duration of keepalive.MaxConnectionAge.
- Forcibly closes a connection after an additive period of keepalive.MaxConnectionAgeGrace over keepalive.MaxConnectionAge.
- Makes sure a connection is alive by sending pings with a frequency of keepalive.Time and closes a non-resposive connection after an additional duration of keepalive.Timeout.