Skip to content

Commit bfa3b9a

Browse files
committed
added Thread.Sleep(1) in order to decrease the CPU usage
1 parent e1f4b3e commit bfa3b9a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

TCP_Server_Client_Tester/MainWindow.xaml.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ void TcpServerLoop()
219219
serverState = Tcp.CLOSE;
220220
break;
221221
}
222+
Thread.Sleep(1); //for decreasing the CPU usage
222223
}
223224
}
224225
catch (Exception Ex)
@@ -416,6 +417,7 @@ void TcpClientLoop()
416417
clientState = Tcp.CLOSE;
417418
break;
418419
}
420+
Thread.Sleep(1); //for decreasing the CPU usage
419421
}
420422
}
421423
catch (Exception Ex)

0 commit comments

Comments
 (0)