/// <summary> /// Returns a port if given in ServerDomain-string or the standard port number depending on context. /// </summary> public int GetPort(bool secure = false) { int p = 0; Int32.TryParse(ServerDomain.Split(':').Last(), out p); return(p == 0 ? (secure ? 443 : 80) : p); }