-
Notifications
You must be signed in to change notification settings - Fork 282
Description
I'm primarily implementing bidirectional streamings for real time data communication between clients and servers. My bidirectional streaming is designed to maintain a persistent connection once it's established. It's a service where the connection between the client and server must remain active 24/7.
However, I need to find a way for the server to detect if the user logs out or the connection is lost. It appears that dart grpc server cannot directly configure a connection timeout. ServerKeepAliveOptions's ping strike seems to be a passive disconnection mechanism, relying on the client's ping rather than an active server-initiated disconnect. Similarly, ServerSettings(concurrentStreamLimit: value) doesn't proactively terminate connections.
While client-side keepAlive can be configured, I'm looking for server-side solutions to manage connections when dealing with clients I don't control or in the event of a malicious attempt of exhausting my server's resources related with sockets or file descriptors.
Here are my specific questions:
- Can the server send keepalive pings to the client?
- Is it possible to configure the server to close idle connections that exceed a maximum allowed time without any RPC activity? (e.g.
ServerParameters.MaxConnectionIdleorServerParameters.MaxConnectionIdleof golang gRPC) - How is server side connection cleanup currently implemented ?