Created
June 3, 2016 16:15
-
-
Save jmcguirk/2c52c301a1762106220905ace5e5ce6c 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