* closing the connections that don't need to be open and keeping track of the connections that should stay open