我使用的是phusion passenger版本4.0.35
我的websocket_rails.rb文件
WebsocketRails.setup do |config|
config.log_level = :debug
config.log_internal_events = false
if Rails.env.production?
config.standalone = true
else
config.standalone = false
end
config.synchronize = false
end在我使用的普通控制器中,如下所示
connection1 = WebsocketRails.users[one_user_id]
connection1.send_message :online, @reply.to_json(:methods => required_methods)
connection2 = WebsocketRails.users[another_other_user_id]
connection2.send_message :online, @reply.to_json(:methods => required_methods)在客户端
var socket_path = document.domain + ":3001" + '/websocket'
var dispatcher = new WebSocketRails(socket_path)
dispatcher.bind('online', function(data){
.................
..................................
}问题是,当我在控制器上调用send_message时,我得到了两次响应,两个用户都得到了两次响应。
另一件事是,它在普通服务器模式下的开发中工作得很好,该模式运行在瘦服务器上。
发布于 2014-01-31 22:15:00
您可以使用.deliver函数吗
Actionmailer not delivering mail, with rails 3这会对你有帮助,让我知道
https://stackoverflow.com/questions/21481806
复制相似问题