new user problem about xmpp4r

P

Pat Kiatchaipipat

Hi. I'm mew user of xmpp4r. After I install xmpp4r and xmpp4r-sample
completely.

and I go to C:\Program
Files\Ruby\lib\ruby\gems\1.8\gems\xmpp4r-0.3.2\data\doc\xmpp4r\examples\basic

that I found many example program and I choose change_password.rb to
work in command line.

then I type

change_password (e-mail address removed) ***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???
 
L

Lokesh Agrawal

I am also facing the same problem.
I think there is an issue with xmpp4r.
Can anyone give any solution????



Thanks and Regards
Lokesh Agrawal
 
P

Phillip Gawlowski

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Pat Kiatchaipipat wrote:

| then I type
|
| change_password (e-mail address removed) ***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 Gawlowski
Twitter: twitter.com/cynicalryan
Blog: http://justarubyist.blogspot.com

<ZAP> 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-----
 
L

Lokesh Agrawal

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
 
P

Phillip Gawlowski

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lokesh Agrawal wrote:
A: It makes it unnecessarily difficult to follow the conversation.
Q: Why is top-posting bad?

| Hi Phillip,
|
| Thanks for reply.
|
| I am running a simple script to send message to a gtalk user.
| But I am getting same error.
| I think using xmmp4r-simple we should be able to send message to a gtalk
| user.

Take a look at GTalk's help page, and see how clients are supposed to
connect to GTalk.

Otherwise, it might help to ask on the xmpp4r/xmpp4r-simple mailing list.

| Or is there anyother way in ruby by which i can send message to a gtalk
| user

Yes, via Socket. Dunno if you want to do that, though, since you'll have
to do everything yourself.

- --
Phillip Gawlowski
Twitter: twitter.com/cynicalryan
Blog: http://justarubyist.blogspot.com

Worship God. Love People. Use Things. Don't Mix Them Up!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkgesYAACgkQbtAgaoJTgL+7hwCdGAGe4swtQHgZo+10ZtH4F5PX
CSkAn1IW+4JxB6xV6vVMda5jj1F+HXs1
=2anX
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top