Wait for sockets to finish