Created
June 11, 2009 00:40
-
-
Save aberant/127621 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
# 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