Skip to content

Instantly share code, notes, and snippets.

@Najaf

Najaf/echo-server.rb

Created May 28, 2014
Embed
What would you like to do?
#! /usr/bin/env ruby
require 'socket'
server = TCPServer.new ARGV.first.to_i
loop do
client = server.accept
client.write(client.readline)
client.close
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment