From: Lokesh Agrawal Date: 2008-05-05T15:40:56+09:00 Subject: Re: XMPP client with Ruby Hi Zablon, When I am running your code i am getting error: 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 gtalk123.rb:3:in `new' from gtalk123.rb:3 Can you please help. Regards Lokesh Agrawal Zablon Ochomo wrote: > Thanks for your help. > > I googled out on xmppr4-simple. It appears to easier and working well. > Here is the code that runs well with ejabberd sever: > > require 'rubygems' > require 'xmpp4r-simple' > im = Jabber::Simple.new('zo@myejabberd','zo') > > im.deliver('gm@myejabberd','hello xmpp') > > puts 'send done' > sleep(3) > > im.received_messages { |msg| puts "#{msg.body} #{msg.type}" } > > im.disconnect > > --- > > ochomo -- Posted via http://www.ruby-forum.com/.