Handling of Client and Server shutting down scenarios