Skip to content

Instantly share code, notes, and snippets.

@azenla
Created August 11, 2013 02:09
Show Gist options
  • Save azenla/6203074 to your computer and use it in GitHub Desktop.
Save azenla/6203074 to your computer and use it in GitHub Desktop.
Simple Echo Server in Groovy
def server = new ServerSocket(2050)
while (!server.isClosed()) {
server.accept({
def input = it.inputStream.newReader()
def output = new PrintStream(it.outputStream)
while (!it.isClosed()) {
output.println(input.readLine())
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment