Automatical selection of next available port