I want to reuse this code and not open the connection and the channel rapedatly. if i do it, when i need to close the resurces, and not get a resource leaks?