Add port attach/detach waiting func.
improve logging