wait for both sockets to close before exiting