Hi all!
I'm new to Ruby and Blather so I'm asking to take that into account :)
I'm trying to establish XMPP communication with Google Cloud Messaging server with Blather but currently I cant even establish TLS connection.
I'm able to connect to Google Talk and send a message to another Google talk account and recieve the reply, but when I change the arguments for GCM server connection when_ready handler doesn't work at all.
What I'm trying to do is (working example):
require 'rubygems'
require 'blather/client'
when_ready do
end
message :chat?, :body do |m|
say m.from, "You sent: #{m.body}"
end
But when I change the setup method to the following, 'when_ready' method is never called, application just finishes the work with exit code 0:
When I start it in debug mode I can see following in console:
D, [2013-11-25T09:33:27.083506 #14148] DEBUG -- : SENDING: (D:/bin/Ruby200/lib/ruby/gems/2.0.0/gems/blather-0.8.8/lib/blather/stream/client.rb:12:in `start') <stream:stream to='
gcm.googleapis.com' xmlns='jabber:client' xmlns:stream='
http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
After that application stops.
Could you please give me any advice about what I'm doing wrong? Possibly, the problem is in TLS connection establishing?