cleaning, wait for socket close