示例#1
0
文件: Settings.cs 项目: amigin/Lykee
        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;
        }
示例#2
0
        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);
        }