do swatch Reset swatch Start try message reader ReadString Thread Slee

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
do
{
swatch.Reset();
swatch.Start();
try
{
message += reader.ReadString();
Thread.Sleep(tout);
}
catch (Exception)
{
break;
}
p++;
if (p == 32768 / k)
{
swatch.Stop();
time = swatch.Elapsed.Milliseconds * p;
g++;
tout += 2;
writer.Write(time.ToString());
time = p = 0;
message = "";
}
} while (serverSocket.Connected);