Created
December 16, 2010 20:31
-
-
Save zeen/743962 to your computer and use it in GitHub Desktop.
This file contains hidden or 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" | |
client = socket:tcp(); | |
client:connect("localhost", 5582); | |
while true do | |
local ch = client:receive(1); | |
if string.char(0) == ch then | |
local line = io.read("*l"); | |
client:send(line.."\n"); | |
else | |
io.write(ch); | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment