White space and Casing is good.
Just a few things to think about:
#regionis a code smellnot very well accepted. If you have to use#region, then you should look at pullingmoving the code out into a method or its own class.- Use var instead of explicit declarations for obvious variables. This makes the code much easier to scan over.
- If you insist on comments to explain what the method is doing, us the C#
///syntax. This does a couple of things: it allows intellisense to pick up the description when using the library, and there are tools that can take the///comments and create API help documentation. - General practice in C# is to use either m_ or _ at the beginning of class variables. This eliminates the need to use this., which clutters up the code a little.
- Be consistent with your use of
{ }after if statements. It makes it eaasier to focus on the logic when it doesn't have to process changes in the formatting. - In the line
thread.Name = "Client" + i;I would make"Client"a constant. - Separate concerns. For instance:
Console.WriteLinedoes not belong in your server class. - If the constructor doesn't do anything, get rid of it, it is only adding noise to your class.
- In my opinion, class variables should be initialized in the constructor, not on declaration.
- Use meaningful names for variables:
adoes not portray what the variable does.tcpClienton the other hand does. This makes your methods much easier to read. getClientshould beGetClient. C# naming conventions
Most of these are minor, and don't affect the application, they just add that little bit to your code, and will make it easier to read and maintain in the future.