Skip to content

Instantly share code, notes, and snippets.

@aberant
Created June 11, 2009 00:40
Show Gist options
  • Save aberant/127621 to your computer and use it in GitHub Desktop.
Save aberant/127621 to your computer and use it in GitHub Desktop.
# SketchUp sockets are horrible
# try this out, but i get a random amount of garbage on the ends of the strings
# when it reaches SketchUp
require "socket"
gs = TCPserver.open(3333)
addr = gs.addr
addr.shift # removes "AF_INET"
printf("server is on %s\n", addr.join(":"))
while true
Thread.start(gs.accept) do |s|
print(s, " is accepted\n")
while true
s.write("tuio_cursors")
sleep 0.01
end
print(s, " is gone\n")
s.close
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment