Centralized socket name logic