refactor: change port type to ushort

This commit is contained in:
ChsBuffer
2020-10-16 19:29:38 +08:00
parent 86a86a94d8
commit b2ac98b21f
8 changed files with 11 additions and 11 deletions

View File

@@ -140,7 +140,7 @@ namespace Netch.Servers.Shadowsocks
if (!match.Success) throw new FormatException();
data.Hostname = match.Groups["server"].Value;
data.Port = int.Parse(match.Groups["port"].Value);
data.Port = ushort.Parse(match.Groups["port"].Value);
var base64 = ShareLink.URLSafeBase64Decode(match.Groups["base64"].Value);
match = parser.Match(base64);
@@ -156,7 +156,7 @@ namespace Netch.Servers.Shadowsocks
if (!match.Success) throw new FormatException();
data.Hostname = match.Groups["server"].Value;
data.Port = int.Parse(match.Groups["port"].Value);
data.Port = ushort.Parse(match.Groups["port"].Value);
data.EncryptMethod = match.Groups["method"].Value;
data.Password = match.Groups["password"].Value;
}