now release socket after process_loop is done