Function getCurrentPort