handle port connections