Skip to content

Instantly share code, notes, and snippets.

@ss23
Created July 28, 2012 11:36
Show Gist options
  • Save ss23/3192932 to your computer and use it in GitHub Desktop.
Save ss23/3192932 to your computer and use it in GitHub Desktop.
int i = 54321;
boolean started = false;
ServerSocket s;
while (!started) {
try {
s = new ServerSocket(i);
started = true;
} catch (Exception e) {
i++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment