Skip to content

Instantly share code, notes, and snippets.

@unforced
Created November 1, 2013 05:00
Show Gist options
  • Select an option

  • Save unforced/7261130 to your computer and use it in GitHub Desktop.

Select an option

Save unforced/7261130 to your computer and use it in GitHub Desktop.
while(true) {
Socket socket = serverSocket.accept();
new Thread(new Runnable() {
@Override
public void run() {
doSomeStuff(socket);
socket.close(); // Can also just close it in doSomeStuff
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment