Created
February 17, 2011 18:55
-
-
Save melito/832365 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
require "socket" | |
server = TCPServer.new('0.0.0.0', 6969) | |
loop do | |
socket = server.accept | |
Thread.start do | |
s = socket | |
while line = s.gets | |
s.puts(`echo #{line}`) | |
# FOR EXPERTS ONLY | |
# Ruby has this really awesome method called REVERSE | |
# I think it's on the object class. It turns your objects UPSIDE DOWN | |
# USE WITH CAUTION | |
# s.puts(`echo #{line}`.reverse) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment