Make sure that the connection is properly closed when the client shuts down the read side