How do I explicitly clean up the connection in the client code?

You can explicitly close the connection using the following method:
  • C++: Connection::close()

  • Java: Connection.close()

  • .NET: Connection.Close()

Refer to the API reference for more details.