private String getPort ( ) { String url = getUrl ( ) ; int i = url . indexOf ( "://" ) + 3 ; int j = url . indexOf ( "/" , i ) ; String s = i == 2 || j == - 1 ? "" : url . substring ( i , j ) ; i = s . indexOf ( ":" ) ; return i == - 1 ? "" : s . substring ( i + 1 ) ; }
Extract the TCP port from the connection URL .