46 char state = stats[1];
47 char weight = stats[4];
48 int trustlevel = Convert.ToInt32(stats.Substring(6, 2).Trim());
49 int stratus = Convert.ToInt32(stats.Substring(9, 2).Trim().Replace(
"-",
"15"));
50 int lastPoll =
CalcPoll(stats.Substring(11, 6));
51 int pollFrequency =
CalcPoll(stats.Substring(17, 6));
53 string value = stats.Substring(31, 10).Trim().Replace(
"ms",
string.Empty);
54 double offset =
double.TryParse(value, out result)
58 value = stats.Substring(41, 10).Trim().Replace(
"ms",
string.Empty);
59 double delay =
double.TryParse(value, out result)
63 value = stats.Substring(51, stats.Length - 51).Trim().Replace(
"ms",
string.Empty);
64 double jitter =
double.TryParse(value, out result)
68 string remote = peer.Substring(0, peer.IndexOf(
" ", StringComparison.Ordinal)).Trim();
71 hostId, state, remote, null, stratus, weight,
72 lastPoll, pollFrequency, trustlevel,
73 delay, offset, jitter);
static int CalcPoll(string pollString)