public static ClientSocketSetup ParseHostPort(string hostPort) { var hostAndPort = hostPort.Split(':'); if (hostAndPort.Length != 2) throw new Exception("Invalid hostPort : [" + hostPort + "]"); var result = new ClientSocketSetup { Host = hostAndPort[0], Port = int.Parse(hostAndPort[1]) }; return result; }
public static ClientSocketSetup ParseHostPort(string hostPort) { var hostAndPort = hostPort.Split(':'); if (hostAndPort.Length != 2) { throw new Exception("Invalid hostPort : [" + hostPort + "]"); } var result = new ClientSocketSetup { Host = hostAndPort[0], Port = int.Parse(hostAndPort[1]) }; return(result); }