我想将填充有数据的哈希从 EventMachine 客户端发送到服务器。问题是服务器 receive_date 方法只打印一个字符串。
服务器:
def receive_data(data)
send_data("Ready")
puts data[:total]
end
客户端:
def receive_data(data)
send_data( get_memory() )
end
def get_memory
sigar = Sigar.new
mem = sigar.mem
swap = sigar.swap
memory = { :total => (mem.total / 1024), :cat => "kwiki", :mouse => "squeaky" }
end
这一行: puts data[:total]
只打印零