class Ubiquity::Server
Public Class Methods
new(port=1978)
click to toggle source
# File lib/ubiquity/protocol.rb, line 23 def initialize port=1978 @scope = {} server = TCPServer.new port puts "Ubiquity server listening on port 0.0.0.0:#{port}" $client = server.accept while line = $client.gets block = JSON.parse(line) c = eval(block["cmd"]) c.call @scope, self end $client.close end