Hi Phillip,
Thanks for reply.
I am running a simple script to send message to a gtalk user.
require ‘rubygems’
require ‘xmpp4r-simple’
username = ‘myusername’
password = ‘mypassword’
$to_username = ‘destnationusername’
puts “connecting to jabber server…”
jabber = Jabber::Simple.new(username+’@gmail.com’, password)
puts “Connected.”
jabber.deliver($to_username+"@gmail.com", “Hello…!”)
Thread.new{
while true
jabber.deliver($to_username+"@gmail.com", $stdin.gets)
puts “-”*80
end
}
while (true) do
jabber.received_messages do |msg|
puts “=”*80
$to_username = msg.from.node
puts msg.from.node + “:” + msg.body
end
sleep(1)
end
But I am getting same error.
connecting to jabber server…
c:/ruby/lib/ruby/gems/1.8/gems/xmpp4r-0.3.1/lib/xmpp4r/connection.rb:53:in
init ialize': Bad file descriptor - connect(2) (Errno::EBADF) from c:/ruby/lib/ruby/gems/1.8/gems/xmpp4r-0.3.1/lib/xmpp4r/connection.r b:53:in
new’
from
c:/ruby/lib/ruby/gems/1.8/gems/xmpp4r-0.3.1/lib/xmpp4r/connection.r
b:53:in connect' from c:/ruby/lib/ruby/gems/1.8/gems/xmpp4r-0.3.1/lib/xmpp4r/client.rb:73 :in
connect’
from
c:/ruby/lib/ruby/gems/1.8/gems/xmpp4r-0.3.1/lib/xmpp4r/client.rb:60
:in connect' from c:/ruby/lib/ruby/gems/1.8/gems/xmpp4r-0.3.1/lib/xmpp4r/client.rb:58 :in
each’
from
c:/ruby/lib/ruby/gems/1.8/gems/xmpp4r-0.3.1/lib/xmpp4r/client.rb:58
:in connect' from c:/ruby/lib/ruby/gems/1.8/gems/xmpp4r-simple-0.8.4/lib/xmpp4r-simpl e.rb:371:in
connect!’
from
c:/ruby/lib/ruby/gems/1.8/gems/xmpp4r-simple-0.8.4/lib/xmpp4r-simpl
e.rb:309:in client' from c:/ruby/lib/ruby/gems/1.8/gems/xmpp4r-simple-0.8.4/lib/xmpp4r-simpl e.rb:318:in
send!’
from
c:/ruby/lib/ruby/gems/1.8/gems/xmpp4r-simple-0.8.4/lib/xmpp4r-simpl
e.rb:134:in status' from c:/ruby/lib/ruby/gems/1.8/gems/xmpp4r-simple-0.8.4/lib/xmpp4r-simpl e.rb:85:in
initialize’
from gtalk.rb:9:in `new’
from gtalk.rb:9
I think using xmmp4r-simple we should be able to send message to a gtalk
user.
Or is there anyother way in ruby by which i can send message to a gtalk
user
Thanks and Regards
Lokesh Agrawal
Phillip G. wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Pat K. wrote:
| then I type
|
| change_password [email protected] my old password my new
| password
|
| and It’s not responding message for long time and show me error like
| this
|
|
|
| Connecting… Error: Bad file descriptor - connect(2)
| …/…/…/…/…/lib/xmpp4r/connection.rb:60:in initialize': Bad file | descriptor | - connect(2) (Errno::EBADF) | from ../../../../../lib/xmpp4r/connection.rb:60:in
new’
| from …/…/…/…/…/lib/xmpp4r/connection.rb:60:in connect' | from ../../../../../lib/xmpp4r/client.rb:71:in
connect’
| from C:/Program
| Files/Ruby/lib/ruby/gems/1.8/gems/xmpp4r-0.3.2/data/doc/
| xmpp4r/examples/basic/change_password.rb:37
| from C:/Program
| Files/Ruby/lib/ruby/gems/1.8/gems/xmpp4r-0.3.2/data/doc/
| xmpp4r/examples/basic/change_password.rb:16:in `with_status’
| from C:/Program
| Files/Ruby/lib/ruby/gems/1.8/gems/xmpp4r-0.3.2/data/doc/
| xmpp4r/examples/basic/change_password.rb:37
|
| C:\Program
| Files\Ruby\lib\ruby\gems\1.8\gems\xmpp4r-0.3.2\data\doc\xmpp4r\exampl
| es\basic>
|
|
| how can I solve this problem???
Simple: While GTalk is a Jabber-based service, it is not a complete
Jabber server. Try the command with a pure Jabber server (one that
doesn’t use SSL, too, though you might not want to change your password
over an insecure channel), like jabber.org.
Phillip G.
Twitter: twitter.com/cynicalryan
Blog: http://justarubyist.blogspot.com
That was not manual override.
~ – Data, “Contagion”, stardate 42609.1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkgerZkACgkQbtAgaoJTgL8ZjgCdEzDehkIGcu88lBNzXHZqXJx8
3toAoJ2VHcnHyR6q1NBsqMsxDEv2UD/u
=4N63
-----END PGP SIGNATURE-----