谁能给个rails+webSocket的简单应用例子
谁能给个rails+webSocket的简单应用例子?
[解决办法]
不知道Rails怎样实现,但看了一下ruby的实现方式(参考Programming Ruby),希望对你有帮助:
service:
require 'soap/rpc/standaloneServer'require 'HelloWorld'NS = "http://test.websoft.com/hello"class Server2 < SOAP::RPC::StandaloneServer def on_init hello = HelloWorld.new add_method(hello, 'hello') add_method(hello, "printToScreen", 'str') endendsvr = Server2.new('hello', NS, '0.0.0.0', 3000)trap('INT') { svr.shutdown }svr.start