Created
June 3, 2016 16:16
-
-
Save jmcguirk/e0439f83b82f1d3f015ccec7ae8fb6bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Run(){ | |
ThreadPool.QueueUserWorkItem((o) => | |
{ | |
while (true) | |
{ | |
TcpClient client = server.AcceptTcpClient(); | |
ThreadPool.QueueUserWorkItem((c) => | |
{ | |
try{ | |
ProcessNewClient(client); | |
} catch(Exception exc){ | |
ServiceLocator.Log.Error("Caught exception processing client " + exc.ToString()); | |
client.Close(); | |
} | |
}); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment